---
title: "Schedule a backfill for rules"
method: POST
path: "/api/alerting/rules/backfill/_schedule"
tags: ["alerting"]
---

# Schedule a backfill for rules

`POST /api/alerting/rules/backfill/_schedule`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/alerting/rules/backfill/_schedule</span></div>

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

## Headers

- `kbn-xsrf` string, required

## Request body

- object[]
  - `ranges` object[], required
    - `end` string, required
    - `start` string, required
  - `rule_id` string, required
  - `run_actions` boolean

## Response `200`

Indicates a successful call.

- union[]
  - union
    - KibanaHTTPAPIsBackfillResponse
      - `created_at` string, required
      - `duration` string, required
      - `enabled` boolean, required
      - `end` string
      - `id` string, required
      - `initiator` 'user' | 'system', required
      - `initiator_id` string
      - `rule` object, required
        - `api_key_created_by_user` boolean, nullable
        - `api_key_owner` string, nullable
        - `consumer` string, required
        - `created_at` string, required
        - `created_by` string, nullable
        - `enabled` boolean, required
        - `id` string, required
        - `name` string, required
        - `params` object, required — The parameters for the rule.
        - `revision` number, required
        - `rule_type_id` string, required
        - `schedule` object, required
          - `interval` string, required
        - `tags` string[], required
        - `updated_at` string, required
        - `updated_by` string, nullable
      - `schedule` object[], required
        - `interval` string, required
        - `run_at` string, required
        - `status` 'complete' | 'pending' | 'running' | 'error' | 'timeout', required
      - `space_id` string, required
      - `start` string, required
      - `status` 'complete' | 'pending' | 'running' | 'error' | 'timeout', required
    - KibanaHTTPAPIsBackfillErrorResponse
      - `error` object, required
        - `message` string, required
        - `rule` object, required
          - `id` string, required
          - `name` string
        - `status` number

## Other responses

- `400` — Indicates an invalid schema or parameters.
- `403` — Indicates that this call is forbidden.
- `404` — Indicates a rule with the given ID does not exist.

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
