---
type: api
title: Enable an SLO
description: You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.<br/><br/>[Required authorization] Route required privileges: slo_write.
url: https://www.elastic.co/elastic/docs-builder/docs/4843/api/doc/kibana-serverless/operation/operation-enablesloop
resource: https://www.elastic.co/elastic/docs-builder/docs/4843/api/doc/kibana-serverless/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 privileges

- 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

#### Invalid SLO id

`application/json`

```json
{
  "error": "Bad Request",
  "message": "[\n  {\n    \u0022origin\u0022: \u0022string\u0022,\n    \u0022code\u0022: \u0022too_small\u0022,\n    \u0022minimum\u0022: 8,\n    \u0022inclusive\u0022: true,\n    \u0022path\u0022: [\n      \u0022id\u0022\n    ],\n    \u0022message\u0022: \u0022Invalid slo id, must be between 8 and 48 characters and contain only letters, numbers, hyphens, and underscores\u0022\n  },\n  {\n    \u0022origin\u0022: \u0022string\u0022,\n    \u0022code\u0022: \u0022invalid_format\u0022,\n    \u0022format\u0022: \u0022regex\u0022,\n    \u0022pattern\u0022: \u0022/^[a-z0-9-_]\u002B$/\u0022,\n    \u0022path\u0022: [\n      \u0022id\u0022\n    ],\n    \u0022message\u0022: \u0022Invalid slo id, must be between 8 and 48 characters and contain only letters, numbers, hyphens, and underscores\u0022\n  }\n]",
  "statusCode": 400
}
```

#### Unauthorized

`application/json`

```json
{
  "error": "Unauthorized",
  "message": "[security_exception\n\tRoot causes:\n\t\tsecurity_exception: unable to authenticate user [elastic] for REST request [/_security/_authenticate]]: unable to authenticate user [elastic] for REST request [/_security/_authenticate]",
  "statusCode": 401
}
```

#### Forbidden

`application/json`

```json
{
  "error": "Forbidden",
  "message": "API [POST /api/observability/slos/8853df00-ae2e-11ed-90af-09bb6422b258/enable] is unauthorized for user, this action is granted by the Kibana privileges [slo_write]",
  "statusCode": 403
}
```

#### Not found

`application/json`

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

