Spaces method and path for this operation:
post /s/{space_id}/api/observability/slos/_bulk_purge_rollup
Refer to Spaces for more information.
The deletion occurs for the specified list of sloId. You must have all privileges for the SLOs feature in the Observability section of the Kibana feature privileges.
[Required authorization] Route required privileges: slo_write.
POST
/api/observability/slos/_bulk_purge_rollup
curl \
--request POST 'https://<KIBANA_URL>/api/observability/slos/_bulk_purge_rollup' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{
"list": [
"8853df00-ae2e-11ed-90af-09bb6422b258"
],
"purgePolicy": {
"age": "7d",
"purgeType": "fixed_age"
}
}'
Request examples
Purge rollup data older than 7 days
{
"list": [
"8853df00-ae2e-11ed-90af-09bb6422b258"
],
"purgePolicy": {
"age": "7d",
"purgeType": "fixed_age"
}
}
{
"list": [
"8853df00-ae2e-11ed-90af-09bb6422b258",
"d077e940-1515-11ee-9c50-9d096392f520"
],
"purgePolicy": {
"purgeType": "fixed_time",
"timestamp": "2024-12-31T00:00:00.000Z"
}
}
Response examples (200)
{
"taskId": "-sOV3daHSeqIWgQLNaKYtw:35832"
}
Response examples (400)
Invalid purge policy type
{
"error": "Bad Request",
"message": "[\n {\n \"code\": \"invalid_union\",\n \"errors\": [],\n \"note\": \"No matching discriminator\",\n \"discriminator\": \"purgeType\",\n \"options\": [\n \"fixed_age\",\n \"fixed_time\"\n ],\n \"path\": [\n \"purgePolicy\",\n \"purgeType\"\n ],\n \"message\": \"Invalid discriminator value. Expected 'fixed_age' | 'fixed_time'\"\n }\n]",
"statusCode": 400
}
{
"error": "Bad Request",
"message": "The provided purge policy is invalid. At least one SLO has a time window that is longer than the provided purge policy.",
"statusCode": 400
}
Response examples (401)
{
"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
}
Response examples (403)
{
"error": "Forbidden",
"message": "API [POST /api/observability/slos/_bulk_purge_rollup] is unauthorized for user, this action is granted by the Kibana privileges [slo_write]",
"statusCode": 403
}