Kibana slo API
SLO APIs enable you to define, manage and track service-level objectives
SLO APIs enable you to define, manage and track service-level objectives
openapi: 3.0.3
info:
contact:
name: Kibana Team
description: 'The Kibana REST APIs enable you to manage resources such as connectors, data views, and saved objects.
The API calls are stateless.
Each request that you make happens in isolation from other calls and must include all of the necessary information for Kibana to fulfill the
request.
API requests return JSON output, which is a format that is machine-readable and works well for automation.
To interact with Kibana APIs, use the following operations:
- GET: Fetches the information.
- PATCH: Applies partial modifications to the existing information.
- POST: Adds new information.
- PUT: Updates the existing information.
- DELETE: Removes the information.
You can prepend any Kibana API endpoint with `kbn:` and run the request in **Dev Tools → Console**.
For example:
```
GET kbn:/api/data_views
```
For more information about the console, refer to [Run API requests](https://www.elastic.co/docs/explore-analyze/query-filter/tools/console).
NOTE: Access to internal Kibana API endpoints will be restricted in Kibana version 9.0. Please move any integrations to publicly documented APIs.
## Documentation source and versions
This documentation is derived from the `main` branch of the [kibana](https://github.com/elastic/kibana) repository.
It is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/).
This documentation contains work-in-progress information for future Elastic Stack releases.
'
title: Kibana APIs Actions slo API
version: ''
x-doc-license:
name: Attribution-NonCommercial-NoDerivatives 4.0 International
url: https://creativecommons.org/licenses/by-nc-nd/4.0/
x-feedbackLink:
label: Feedback
url: https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+
servers:
- url: https://{kibana_url}
variables:
kibana_url:
default: localhost:5601
security:
- apiKeyAuth: []
- basicAuth: []
tags:
- description: SLO APIs enable you to define, manage and track service-level objectives
name: slo
x-displayName: Service level objectives
paths:
/s/{spaceId}/api/observability/slos:
get:
description: 'You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
'
operationId: findSlosOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
- description: A valid kql query to filter the SLO with
example: 'slo.name:latency* and slo.tags : "prod"'
in: query
name: kqlQuery
schema:
type: string
- description: The page size to use for cursor-based pagination, must be greater or equal than 1
example: 1
in: query
name: size
schema:
default: 1
type: integer
- description: The cursor to use for fetching the results from, when using a cursor-base pagination.
in: query
name: searchAfter
schema:
items:
type: string
type: array
- description: The page to use for pagination, must be greater or equal than 1
example: 1
in: query
name: page
schema:
default: 1
type: integer
- description: Number of SLOs returned by page
example: 25
in: query
name: perPage
schema:
default: 25
maximum: 5000
type: integer
- description: Sort by field
example: status
in: query
name: sortBy
schema:
default: status
enum:
- sli_value
- status
- error_budget_consumed
- error_budget_remaining
type: string
- description: Sort order
example: asc
in: query
name: sortDirection
schema:
default: asc
enum:
- asc
- desc
type: string
- description: Hide stale SLOs from the list as defined by stale SLO threshold in SLO settings
in: query
name: hideStale
schema:
type: boolean
responses:
'200':
content:
application/json:
examples:
findSloResponse:
summary: A paginated list of SLOs
value:
page: 1
perPage: 25
results:
- budgetingMethod: occurrences
createdAt: '2025-01-12T10:03:19.000Z'
description: Availability of my web service
enabled: true
groupBy: '*'
id: 8853df00-ae2e-11ed-90af-09bb6422b258
indicator:
params:
filter: 'field.environment : "production" and service.name : "my-service"'
good: 'request.status_code : "2xx"'
index: logs-*
timestampField: '@timestamp'
total: 'request.status_code : *'
type: sli.kql.custom
instanceId: '*'
name: My Service Availability
objective:
target: 0.99
revision: 1
settings:
frequency: 5m
syncDelay: 5m
summary:
errorBudget:
consumed: 0.17
initial: 0.01
isEstimated: false
remaining: 0.83
sliValue: 0.9983
status: HEALTHY
tags:
- production
- web-service
timeWindow:
duration: 30d
type: rolling
updatedAt: '2025-01-12T10:03:19.000Z'
version: 2
total: 42
schema:
$ref: '#/components/schemas/SLOs_find_slo_response'
description: Successful request
'400':
content:
application/json:
examples:
badRequestExample:
summary: Bad request
value:
error: Bad Request
message: 'Invalid value ''invalid'' supplied to: sortBy'
statusCode: 400
schema:
$ref: '#/components/schemas/SLOs_400_response'
description: Bad request
'401':
content:
application/json:
examples:
unauthorizedExample:
summary: Unauthorized
value:
error: Unauthorized
message: 'security_exception: unable to authenticate user for REST request [/api/observability/slos]'
statusCode: 401
schema:
$ref: '#/components/schemas/SLOs_401_response'
description: Unauthorized response
'403':
content:
application/json:
examples:
forbiddenExample:
summary: Forbidden
value:
error: Forbidden
message: 'security_exception: action [slo_read] is unauthorized for user'
statusCode: 403
schema:
$ref: '#/components/schemas/SLOs_403_response'
description: Forbidden response
'404':
content:
application/json:
examples:
notFoundExample:
summary: Not found
value:
error: Not Found
message: SLO [3749f390-03a3-11ee-8139-c7ff60a1692d] not found
statusCode: 404
schema:
$ref: '#/components/schemas/SLOs_404_response'
description: Not found response
summary: Get a paginated list of SLOs
tags:
- slo
x-metaTags:
- content: Kibana
name: product_name
post:
description: 'You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
'
operationId: createSloOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
requestBody:
content:
application/json:
examples:
createSloKqlExample:
summary: Create an SLO with a KQL indicator
value:
budgetingMethod: occurrences
description: Availability of my web service measured by successful HTTP responses
indicator:
params:
filter: 'field.environment : "production" and service.name : "my-service"'
good: 'request.status_code : "2xx"'
index: logs-*
timestampField: '@timestamp'
total: 'request.status_code : *'
type: sli.kql.custom
name: My Service Availability
objective:
target: 0.99
settings:
frequency: 5m
syncDelay: 5m
tags:
- production
- web-service
timeWindow:
duration: 30d
type: rolling
schema:
$ref: '#/components/schemas/SLOs_create_slo_request'
required: true
responses:
'200':
content:
application/json:
examples:
createSloResponse:
summary: Create SLO response
value:
id: 8853df00-ae2e-11ed-90af-09bb6422b258
schema:
$ref: '#/components/schemas/SLOs_create_slo_response'
description: Successful request
'400':
content:
application/json:
examples:
badRequestExample:
summary: Bad request
value:
error: Bad Request
message: 'Invalid value ''foo'' supplied to: indicator/type'
statusCode: 400
schema:
$ref: '#/components/schemas/SLOs_400_response'
description: Bad request
'401':
content:
application/json:
examples:
unauthorizedExample:
summary: Unauthorized
value:
error: Unauthorized
message: 'security_exception: unable to authenticate user for REST request [/api/observability/slos]'
statusCode: 401
schema:
$ref: '#/components/schemas/SLOs_401_response'
description: Unauthorized response
'403':
content:
application/json:
examples:
forbiddenExample:
summary: Forbidden
value:
error: Forbidden
message: 'security_exception: action [slo_write] is unauthorized for user'
statusCode: 403
schema:
$ref: '#/components/schemas/SLOs_403_response'
description: Forbidden response
'409':
content:
application/json:
examples:
conflictExample:
summary: Conflict
value:
error: Conflict
message: SLO [d077e940-1515-11ee-9c50-9d096392f520] already exists
statusCode: 409
schema:
$ref: '#/components/schemas/SLOs_409_response'
description: Conflict - The SLO id already exists
summary: Create an SLO
tags:
- slo
x-metaTags:
- content: Kibana
name: product_name
/s/{spaceId}/api/observability/slos/_bulk_delete:
post:
description: 'Bulk delete SLO definitions and their associated summary and rollup data. This endpoint initiates a bulk deletion operation for SLOs, which may take some time to complete. The status of the operation can be checked using the `GET /api/slo/_bulk_delete/{taskId}` endpoint.
'
operationId: bulkDeleteOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
requestBody:
content:
application/json:
examples:
bulkDeleteRequest:
summary: Bulk delete two SLOs
value:
list:
- 8853df00-ae2e-11ed-90af-09bb6422b258
- d077e940-1515-11ee-9c50-9d096392f520
schema:
$ref: '#/components/schemas/SLOs_bulk_delete_request'
required: true
responses:
'200':
content:
application/json:
examples:
bulkDeleteResponse:
summary: Bulk delete response with task ID
value:
taskId: d08506b7-f0e8-4f8b-a06a-a83940f4db91
schema:
$ref: '#/components/schemas/SLOs_bulk_delete_response'
description: Successful response
'400':
content:
application/json:
examples:
badRequestExample:
summary: Bad request
value:
error: Bad Request
message: 'Invalid value ''foo'' supplied to: list'
statusCode: 400
schema:
$ref: '#/components/schemas/SLOs_400_response'
description: Bad request
'401':
content:
application/json:
examples:
unauthorizedExample:
summary: Unauthorized
value:
error: Unauthorized
message: 'security_exception: unable to authenticate user for REST request [/api/observability/slos]'
statusCode: 401
schema:
$ref: '#/components/schemas/SLOs_401_response'
description: Unauthorized response
'403':
content:
application/json:
examples:
forbiddenExample:
summary: Forbidden
value:
error: Forbidden
message: 'security_exception: action [slo_write] is unauthorized for user'
statusCode: 403
schema:
$ref: '#/components/schemas/SLOs_403_response'
description: Forbidden response
summary: Bulk delete SLO definitions and their associated summary and rollup data.
tags:
- slo
x-metaTags:
- content: Kibana
name: product_name
/s/{spaceId}/api/observability/slos/_bulk_delete/{taskId}:
get:
description: 'Retrieve the status of the bulk deletion operation for SLOs. This endpoint returns the status of the bulk deletion operation, including whether it is completed and the results of the operation.
'
operationId: bulkDeleteStatusOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
- description: The task id of the bulk delete operation
in: path
name: taskId
required: true
schema:
example: 8853df00-ae2e-11ed-90af-09bb6422b258
type: string
responses:
'200':
content:
application/json:
examples:
bulkDeleteStatusComplete:
summary: Completed bulk deletion
value:
isDone: true
results:
- id: 8853df00-ae2e-11ed-90af-09bb6422b258
success: true
- id: d077e940-1515-11ee-9c50-9d096392f520
success: true
bulkDeleteStatusPartialFailure:
summary: Completed with partial failure
value:
isDone: true
results:
- id: 8853df00-ae2e-11ed-90af-09bb6422b258
success: true
- error: SLO [d077e940-1515-11ee-9c50-9d096392f520] not found
id: d077e940-1515-11ee-9c50-9d096392f520
success: false
schema:
$ref: '#/components/schemas/SLOs_bulk_delete_status_response'
description: Successful response
'400':
content:
application/json:
examples:
badRequestExample:
summary: Bad request
value:
error: Bad Request
message: 'Invalid value ''foo'' supplied to: taskId'
statusCode: 400
schema:
$ref: '#/components/schemas/SLOs_400_response'
description: Bad request
'401':
content:
application/json:
examples:
unauthorizedExample:
summary: Unauthorized
value:
error: Unauthorized
message: 'security_exception: unable to authenticate user for REST request [/api/observability/slos]'
statusCode: 401
schema:
$ref: '#/components/schemas/SLOs_401_response'
description: Unauthorized response
'403':
content:
application/json:
examples:
forbiddenExample:
summary: Forbidden
value:
error: Forbidden
message: 'security_exception: action [slo_write] is unauthorized for user'
statusCode: 403
schema:
$ref: '#/components/schemas/SLOs_403_response'
description: Forbidden response
summary: Retrieve the status of the bulk deletion
tags:
- slo
x-metaTags:
- content: Kibana
name: product_name
/s/{spaceId}/api/observability/slos/_bulk_purge_rollup:
post:
description: '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.
'
operationId: deleteRollupDataOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
requestBody:
content:
application/json:
examples:
purgeByAgeExample:
summary: Purge rollup data older than 7 days
value:
list:
- 8853df00-ae2e-11ed-90af-09bb6422b258
purgePolicy:
age: 7d
purgeType: fixed-age
purgeByTimestampExample:
summary: Purge rollup data before a specific date
value:
list:
- 8853df00-ae2e-11ed-90af-09bb6422b258
- d077e940-1515-11ee-9c50-9d096392f520
purgePolicy:
purgeType: fixed-time
timestamp: '2024-12-31T00:00:00.000Z'
schema:
$ref: '#/components/schemas/SLOs_bulk_purge_rollup_request'
required: true
responses:
'200':
content:
application/json:
examples:
bulkPurgeResponse:
summary: Bulk purge response with task ID
value:
taskId: 8853df00-ae2e-11ed-90af-09bb6422b258
schema:
$ref: '#/components/schemas/SLOs_bulk_purge_rollup_response'
description: Successful request
'400':
content:
application/json:
examples:
badRequestExample:
summary: Bad request
value:
error: Bad Request
message: 'Invalid value ''foo'' supplied to: purgePolicy/purgeType'
statusCode: 400
schema:
$ref: '#/components/schemas/SLOs_400_response'
description: Bad request
'401':
content:
application/json:
examples:
unauthorizedExample:
summary: Unauthorized
value:
error: Unauthorized
message: 'security_exception: unable to authenticate user for REST request [/api/observability/slos]'
statusCode: 401
schema:
$ref: '#/components/schemas/SLOs_401_response'
description: Unauthorized response
'403':
content:
application/json:
examples:
forbiddenExample:
summary: Forbidden
value:
error: Forbidden
message: 'security_exception: action [slo_write] is unauthorized for user'
statusCode: 403
schema:
$ref: '#/components/schemas/SLOs_403_response'
description: Forbidden response
summary: Batch delete rollup and summary data
tags:
- slo
x-metaTags:
- content: Kibana
name: product_name
/s/{spaceId}/api/observability/slos/_delete_instances:
post:
description: 'The deletion occurs for the specified list of `sloId` and `instanceId`. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
'
operationId: deleteSloInstancesOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
requestBody:
content:
application/json:
examples:
deleteInstancesExample:
summary: Delete specific SLO instances
value:
list:
- instanceId: host-abc123
sloId: 8853df00-ae2e-11ed-90af-09bb6422b258
- instanceId: host-def456
sloId: 8853df00-ae2e-11ed-90af-09bb6422b258
schema:
$ref: '#/components/schemas/SLOs_delete_slo_instances_request'
required: true
responses:
'204':
description: Successful request
'400':
content:
application/json:
examples:
badRequestExample:
summary: Bad request
value:
error: Bad Request
message: 'Invalid value ''foo'' supplied to: list/0/sloId'
statusCode: 400
schema:
$ref: '#/components/schemas/SLOs_400_response'
description: Bad request
'401':
content:
application/json:
examples:
unauthorizedExample:
summary: Unauthorized
value:
error: Unauthorized
message: 'security_exception: unable to authenticate user for REST request [/api/observability/slos]'
statusCode: 401
schema:
$ref: '#/components/schemas/SLOs_401_response'
description: Unauthorized response
'403':
content:
application/json:
examples:
forbiddenExample:
summary: Forbidden
value:
error: Forbidden
message: 'security_exception: action [slo_write] is unauthorized for user'
statusCode: 403
schema:
$ref: '#/components/schemas/SLOs_403_response'
description: Forbidden response
summary: Batch delete rollup and summary data
tags:
- slo
x-metaTags:
- content: Kibana
name: product_name
/s/{spaceId}/api/observability/slos/{sloId}:
delete:
description: 'You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
'
operationId: deleteSloOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
- $ref: '#/components/parameters/SLOs_slo_id'
responses:
'204':
description: Successful request
'400':
content:
application/json:
examples:
badRequestExample:
summary: Bad request
value:
error: Bad Request
message: 'Invalid value ''foo'' supplied to: id'
statusCode: 400
schema:
$ref: '#/components/schemas/SLOs_400_response'
description: Bad request
'401':
content:
application/json:
examples:
unauthorizedExample:
summary: Unauthorized
value:
error: Unauthorized
message: 'security_exception: unable to authenticate user for REST request [/api/observability/slos]'
statusCode: 401
schema:
$ref: '#/components/schemas/SLOs_401_response'
description: Unauthorized response
'403':
content:
application/json:
examples:
forbiddenExample:
summary: Forbidden
value:
error: Forbidden
message: 'security_exception: action [slo_write] is unauthorized for user'
statusCode: 403
schema:
$ref: '#/components/schemas/SLOs_403_response'
description: Forbidden response
'404':
content:
application/json:
examples:
notFoundExample:
summary: Not found
value:
error: Not Found
message: SLO [3749f390-03a3-11ee-8139-c7ff60a1692d] not found
statusCode: 404
schema:
$ref: '#/components/schemas/SLOs_404_response'
description: Not found response
summary: Delete an SLO
tags:
- slo
x-metaTags:
- content: Kibana
name: product_name
get:
description: 'You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
'
operationId: getSloOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
- $ref: '#/components/parameters/SLOs_slo_id'
- description: the specific instanceId used by the summary calculation
example: host-abcde
in: query
name: instanceId
schema:
type: string
responses:
'200':
content:
application/json:
examples:
getSloResponse:
summary: Get SLO response
value:
budgetingMethod: occurrences
createdAt: '2025-01-12T10:03:19.000Z'
description: Availability of my web service
enabled: true
groupBy: '*'
id: 8853df00-ae2e-11ed-90af-09bb6422b258
indicator:
params:
filter: 'field.environment : "production" and service.name : "my-service"'
good: 'request.status_code : "2xx"'
index: logs-*
timestampField: '@timestamp'
total: 'request.status_code : *'
type: sli.kql.custom
instanceId: '*'
name: My Service Availability
objective:
target: 0.99
revision: 1
settings:
frequency: 5m
syncDelay: 5m
summary:
errorBudget:
consumed: 0.17
initial: 0.01
isEstimated: false
remaining: 0.83
sliValue: 0.9983
status: HEALTHY
tags:
- production
- web-service
timeWindow:
duration: 30d
type: rolling
updatedAt: '2025-01-12T10:03:19.000Z'
version: 2
schema:
$ref: '#/components/schemas/SLOs_slo_with_summary_response'
description: Successful request
'400':
content:
application/json:
examples:
badRequestExample:
summary: Bad request
value:
error: Bad Request
message: 'Invalid value ''foo'' supplied to: id'
statusCode: 400
schema:
$ref: '#/components/schemas/SLOs_400_response'
description: Bad request
'401':
content:
application/json:
examples:
unauthorizedExample:
summary: Unauthorized
value:
error: Unauthorized
message: 'security_exception: unable to authenticate user for REST request [/api/observability/slos]'
statusCode: 401
schema:
$ref: '#/components/schemas/SLOs_401_response'
description: Unauthorized response
'403':
content:
application/json:
examples:
forbiddenExample:
summary: Forbidden
value:
error: Forbidden
message: 'security_exception: action [slo_read] is unauthorized for user'
statusCode: 403
schema:
$ref: '#/components/schemas/SLOs_403_response'
description: Forbidden response
'404':
content:
application/json:
examples:
notFoundExample:
summary: Not found
value:
error: Not Found
message: SLO [3749f390-03a3-11ee-8139-c7ff60a1692d] not found
statusCode: 404
schema:
$ref: '#/components/schemas/SLOs_404_response'
description: Not found response
summary: Get an SLO
tags:
- slo
x-metaTags:
- content: Kibana
name: product_name
put:
description: 'You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.
'
operationId: updateSloOp
parameters:
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
- $ref: '#/components/parameters/SLOs_space_id'
- $ref: '#/components/parameters/SLOs_slo_id'
requestBody:
content:
application/json:
examples:
updateSloNameExample:
summary: Update the SLO name and t
# --- truncated at 32 KB (96 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/kibana/refs/heads/main/openapi/kibana-slo-api-openapi.yml