Spaces method and path for this operation:
post /s/{space_id}/api/maintenance_window
Refer to Spaces for more information.
[Required authorization] Route required privileges: write-maintenance-window.
Body
-
Whether the current maintenance window is enabled. Disabled maintenance windows do not suppress notifications.
-
Additional properties are NOT allowed.
-
Additional properties are NOT allowed.
-
The name of the maintenance window. While this name does not have to be unique, a distinctive name can help you identify a specific maintenance window.
POST
/api/maintenance_window
curl \
--request POST 'https://<KIBANA_URL>/api/maintenance_window' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"enabled":true,"schedule":{"custom":{"duration":"2h","recurring":{"every":"1w","occurrences":10,"onWeekDay":["MO","WE"]},"start":"2025-03-01T08:00:00.000Z","timezone":"Europe/Amsterdam"}},"scope":{"alerting":{"query":{"kql":"kibana.alert.tags: \"infra\""}}},"title":"Weekly Maintenance Window"}'
Request example
Create a maintenance window that recurs every week on Monday and Wednesday for two hours, with a scope that filters specific alerts using a KQL query.
{
"enabled": true,
"schedule": {
"custom": {
"duration": "2h",
"recurring": {
"every": "1w",
"occurrences": 10,
"onWeekDay": [
"MO",
"WE"
]
},
"start": "2025-03-01T08:00:00.000Z",
"timezone": "Europe/Amsterdam"
}
},
"scope": {
"alerting": {
"query": {
"kql": "kibana.alert.tags: \"infra\""
}
}
},
"title": "Weekly Maintenance Window"
}
Response examples (200)
The response returned when a maintenance window is successfully created.
{
"created_at": "2025-02-25T10:00:00.000Z",
"created_by": "elastic",
"enabled": true,
"id": "f0cb1780-537a-4e34-8adf-3b4336862858",
"schedule": {
"custom": {
"duration": "2h",
"recurring": {
"every": "1w",
"occurrences": 10,
"onWeekDay": [
"MO",
"WE"
]
},
"start": "2025-03-01T08:00:00.000Z",
"timezone": "Europe/Amsterdam"
}
},
"scope": {
"alerting": {
"query": {
"kql": "kibana.alert.tags: \"infra\""
}
}
},
"status": "upcoming",
"title": "Weekly Maintenance Window",
"updated_at": "2025-02-25T10:00:00.000Z",
"updated_by": "elastic"
}