---
type: api
title: Schedule a snooze for the rule
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-post-alerting-rule-id-snooze-schedule
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-post-alerting-rule-id-snooze-schedule
products:
  - Kibana
---

# Schedule a snooze for the rule

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

## Paths

- `POST` `/api/alerting/rule/{id}/snooze_schedule`
- `POST` `/s/{space_id}/api/alerting/rule/{id}/snooze_schedule`

#### Path parameters

- `id` (string) — required
  Identifier of the rule.

## Description

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

When you snooze a rule, the rule checks continue to run but alerts will not generate actions. You can snooze for a specified period of time and schedule single or recurring downtimes.

## Authentication

- Api key: `Authorization: <value>`
  You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/docs/current/serverless/api-keys).

## Header parameters

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

## Request body

`application/json`

- `schedule` (object) — required
  - `custom` (object) — optional
    - `duration` (string · max length: 100) — required
      The duration of the schedule. It allows values in `<integer><unit>` format. `<unit>` is one of `d`, `h`, `m`, or `s` for hours, minutes, seconds. For example: `1d`, `5h`, `30m`, `5000s`.
    - `recurring` (object) — optional
      - `end` (string · max length: 100) — optional
        The end date of a recurring schedule, provided in ISO 8601 format and set to the UTC timezone. For example: `2025-04-01T00:00:00.000Z`.
      - `every` (string · max length: 100) — optional
        The interval and frequency of a recurring schedule. It allows values in `<integer><unit>` format. `<unit>` is one of `d`, `w`, `M`, or `y` for days, weeks, months, years. For example: `15d`, `2w`, `3m`, `1y`.
      - `occurrences` (number · min: 1) — optional
        The total number of recurrences of the schedule.
      - `onMonth` (number[] · min items: 1 · max items: 12) — optional
        The specific months for a recurring schedule. Valid values are 1-12.
      - `onMonthDay` (number[] · min items: 1 · max items: 31) — optional
        The specific days of the month for a recurring schedule. Valid values are 1-31.
      - `onWeekDay` (string[] · min items: 1 · max items: 77) — optional
        The specific days of the week (`[MO,TU,WE,TH,FR,SA,SU]`) or nth day of month (`[+1MO, -3FR, +2WE, -4SA, -5SU]`) for a recurring schedule.
    - `start` (string · max length: 100) — required
      The start date and time of the schedule, provided in ISO 8601 format and set to the UTC timezone. For example: `2025-03-12T12:00:00.000Z`.
    - `timezone` (string · max length: 64) — optional
      The timezone of the schedule. The default timezone is UTC.

## Responses

#### `200`

Indicates a successful call.

`application/json`

- `body` (object)
  - `schedule` (object)
    - `custom` (object)
      Same fields as `custom` in `schedule`
    - `id` (string)
      Identifier of the snooze schedule.
#### `400`

Indicates an invalid schema.

#### `403`

Indicates that this call is forbidden.

#### `404`

Indicates a rule with the given id does not exist.

## Code examples

#### Console

```console
POST kbn:/api/alerting/rule/ID/snooze_schedule
{
  "schedule": {
    "custom": {
      "duration": "8h",
      "recurring": {
        "every": "1w",
        "occurrences": 4,
        "onWeekDay": [
          "MO"
        ]
      },
      "start": "2025-03-17T09:00:00.000Z",
      "timezone": "UTC"
    }
  }
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/alerting/rule/${ID}/snooze_schedule" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "schedule": {
      "custom": {
        "duration": "8h",
        "recurring": {
          "every": "1w",
          "occurrences": 4,
          "onWeekDay": [
            "MO"
          ]
        },
        "start": "2025-03-17T09:00:00.000Z",
        "timezone": "UTC"
      }
    }
  }'
```

## Response examples

#### Snooze schedule response

A response that contains the created snooze schedule.

```json
{
  "schedule": {
    "custom": {
      "duration": "24h",
      "start": "2025-03-12T12:00:00.000Z",
      "timezone": "UTC"
    },
    "id": "9ac67950-6737-11ec-8ded-d7f6e1581b26"
  }
}
```

