---
type: api
title: Update uptime settings
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-put-uptime-settings
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-put-uptime-settings
products:
  - Kibana
---

# Update uptime settings

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

## Paths

- `PUT` `/api/uptime/settings`
- `PUT` `/s/{space_id}/api/uptime/settings`

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Update uptime setting attributes like `heartbeatIndices`, `certExpirationThreshold`, `certAgeThreshold`, `defaultConnectors`, or `defaultEmail`. You must have `all` privileges for the uptime feature in the Observability section of the Kibana feature privileges. A partial update is supported, provided settings keys will be merged with existing settings.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Request body

`application/json`

- `certAgeThreshold` (number · default: 730) — optional
  The number of days after a certificate is created to trigger an alert.
- `certExpirationThreshold` (number · default: 30) — optional
  The number of days before a certificate expires to trigger an alert.
- `defaultConnectors` (unknown[] · default: []) — optional
  A list of connector IDs to be used as default connectors for new alerts.
- `defaultEmail` (object) — optional
  The default email configuration for new alerts.
  - `bcc` (string[] · default: []) — optional
  - `cc` (string[] · default: []) — optional
  - `to` (string[] · default: []) — optional
- `heartbeatIndices` (string · default: heartbeat-*) — optional
  An index pattern string to be used within the Uptime app and alerts to query Heartbeat data.

## Response

Indicates a successful call

`application/json`

Type: `object`

## Code examples

#### Console

```console
PUT kbn:/api/uptime/settings
{
    "heartbeatIndices": "heartbeat-8*",
    "certExpirationThreshold": 30,
    "certAgeThreshold": 730,
    "defaultConnectors": [
        "08990f40-09c5-11ee-97ae-912b222b13d4",
        "db25f830-2318-11ee-9391-6b0c030836d6"
    ],
    "defaultEmail": {
        "to": [],
        "cc": [],
        "bcc": []
    }
}
```

#### curl

```curl
curl -X PUT "${KIBANA_URL}/api/uptime/settings" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
      "heartbeatIndices": "heartbeat-8*",
      "certExpirationThreshold": 30,
      "certAgeThreshold": 730,
      "defaultConnectors": [
          "08990f40-09c5-11ee-97ae-912b222b13d4",
          "db25f830-2318-11ee-9391-6b0c030836d6"
      ],
      "defaultEmail": {
          "to": [],
          "cc": [],
          "bcc": []
      }
  }'
```

## Response examples

#### Put uptime settings response example1

A successful response from `PUT api/uptime/settings`.

```json
{
    "heartbeatIndices": "heartbeat-8*",
    "certExpirationThreshold": 30,
    "certAgeThreshold": 730,
    "defaultConnectors": [
        "08990f40-09c5-11ee-97ae-912b222b13d4",
        "db25f830-2318-11ee-9391-6b0c030836d6"
    ],
    "defaultEmail": {
        "to": [],
        "cc": [],
        "bcc": []
    }
}
```

