---
type: api
title: "Update the global SLO settings"
description: "Global SLO settings apply to all spaces. You must have all privileges for the SLOs feature in the Observability section of the Kibana feature privileges in all spaces. You must also have the delete_index index privilege on .slo-observability.sli-*, because the SLI retention deletes SLI data for SLOs in all spaces. Each settings block is replaced as a whole. When xpack.slo.sliRetention is set in kibana.yml, the request still saves the value, and the kibana.yml value stays effective until it is removed. [Required authorization] Route required privileges: slo_write."
url: https://www.elastic.co/elastic/docs-builder/docs/5107/api/kibana-serverless/operation/operation-updatesloglobalsettingsop
resource: https://www.elastic.co/elastic/docs-builder/docs/5107/api/kibana-serverless/operation/operation-updatesloglobalsettingsop
products:
  - Kibana
---

# Update the global SLO settings

Authentication: required

Availability: Preview

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

## Paths

- `PUT` `/api/observability/slo_settings/global`
- `PUT` `/s/{space_id}/api/observability/slo_settings/global`

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

Global SLO settings apply to all spaces. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges in all spaces. You must also have the `delete_index` index privilege on `.slo-observability.sli-*`, because the SLI retention deletes SLI data for SLOs in all spaces. Each settings block is replaced as a whole. When `xpack.slo.sliRetention` is set in `kibana.yml`, the request still saves the value, and the `kibana.yml` value stays effective until it is removed.

## Required privileges

- Privileges: `slo_write`

## Header parameters

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

## Request body

`application/json`

- `sliRetention` (object) — required
  The SLI retention settings. The request replaces the whole block.
  - `enabled` (boolean) — required
    Indicates if dated SLI indices older than the retention period are deleted
  - `periodDays` (integer · min: 180 · max: 3650) — required
    The number of days of SLI data kept when SLI retention is enabled

## Responses

#### `200`

Successful request

`application/json`

- `sliRetention` (object)
  `enabled` and `periodDays` hold the saved values, or the defaults when nothing was saved.
  - `effective` (object)
    - `enabled` (boolean)
      Indicates if SLI retention is enabled
    - `periodDays` (integer · min: 1 · max: 9007199254740991)
      The number of days of SLI data to keep
    - `source` (enum)
      Where the resolved value comes from: `default` is the built-in value, `settings` is the saved value, and `config` is the `xpack.slo.sliRetention` setting in `kibana.yml`
      Values: `default`, `settings`, `config`
  - `enabled` (boolean)
    Indicates if dated SLI indices older than the retention period are deleted
  - `periodDays` (integer · min: 1 · max: 9007199254740991)
    The number of days of SLI data kept when SLI retention is enabled
  - `updatedAt` (string · format: date-time · max length: 128) — nullable
    When the SLI retention was last saved, or null when it was never saved
#### `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
PUT kbn:/api/observability/slo_settings/global
{
  "sliRetention": {
    "enabled": true,
    "periodDays": 365
  }
}
```

#### curl

```curl
curl -X PUT "${KIBANA_URL}/api/observability/slo_settings/global" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "sliRetention": {
      "enabled": true,
      "periodDays": 365
    }
  }'
```

## Response examples

#### Saved global SLO settings

`application/json`

```json
{
  "sliRetention": {
    "effective": {
      "enabled": true,
      "periodDays": 365,
      "source": "settings"
    },
    "enabled": true,
    "periodDays": 365,
    "updatedAt": "2026-11-24T10:00:00.000Z"
  }
}
```

#### Retention period below the minimum

`application/json`

```json
{
  "error": "Bad Request",
  "message": "[\n  {\n    \u0022origin\u0022: \u0022number\u0022,\n    \u0022code\u0022: \u0022too_small\u0022,\n    \u0022minimum\u0022: 180,\n    \u0022inclusive\u0022: true,\n    \u0022path\u0022: [\n      \u0022sliRetention\u0022,\n      \u0022periodDays\u0022\n    ],\n    \u0022message\u0022: \u0022Too small: expected number to be \u003E=180\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
}
```

#### Missing the SLO privilege in some spaces

`application/json`

```json
{
  "error": "Forbidden",
  "message": "Global SLO settings require the SLO \u0022All\u0022 privilege in all spaces",
  "statusCode": 403
}
```

#### Missing the SLI index delete privilege

`application/json`

```json
{
  "error": "Forbidden",
  "message": "Updating global SLO settings requires the \u0022delete_index\u0022 privilege on .slo-observability.sli-* indices",
  "statusCode": 403
}
```

