---
title: "Get an SLO's history"
method: GET
path: "/api/v1/slo/{slo_id}/history"
tags: ["Service Level Objectives"]
---

# Get an SLO's history

`GET /api/v1/slo/{slo_id}/history`

Get a specific SLO’s history, regardless of its SLO type.

The detailed history data is structured according to the source data type.
For example, metric data is included for event SLOs that use
the metric source, and monitor SLO types include the monitor transition history.

**Note:** There are different response formats for event based and time based SLOs.
Examples of both are shown.

## Path parameters

- `slo_id` string, required

## Query parameters

- `from_ts` integer, required
- `to_ts` integer, required
- `target` number, double
- `apply_correction` boolean

## Response `200`

OK

- SLOHistoryResponse — A service level objective history response.
  - `data` SLOHistoryResponseData — An array of service level objective objects.
    - `from_ts` integer — The `from` timestamp in epoch seconds.
    - `group_by` string[] — For `metric` based SLOs where the query includes a group-by clause, this represents the list of grouping parameters. This is not included in responses for `monitor` based SLOs.
    - `groups` SLOHistoryMonitor[] — For grouped SLOs, this represents SLI data for specific groups. This is not included in the responses for `metric` based SLOs.
      - `error_budget_remaining` SLOErrorBudgetRemainingData — A mapping of threshold `timeframe` to the remaining error budget.
      - `errors` SLOHistoryResponseErrorWithType[] — An array of error objects returned while querying the history data for the service level objective.
        - `error_message` string, required — A message with more details about the error.
        - `error_type` string, required — Type of the error.
      - `group` string — For groups in a grouped SLO, this is the group name.
      - `history` array[] — The state transition history for the monitor. It is represented as an array of pairs. Each pair is an array containing the timestamp of the transition as an integer in Unix epoch format in the first element, and the state as an integer in the second element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data. Periods of no data are counted either as uptime or downtime depending on monitor settings. See [SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data) for detailed information.
        - number[] — Represents an array timeseries data.
      - `monitor_modified` integer — For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor.
      - `monitor_type` string — For `monitor` based SLOs, this describes the type of monitor.
      - `name` string — For groups in a grouped SLO, this is the group name. For monitors in a multi-monitor SLO, this is the monitor name.
      - `precision` number, double — The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp. Use `span_precision` instead.
      - `preview` boolean — For `monitor` based SLOs, when `true` this indicates that a replay is in progress to give an accurate uptime calculation.
      - `sli_value` number, double, nullable — The current SLI value of the SLO over the history window.
      - `span_precision` number, double — The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp.
      - `uptime` number, double — Use `sli_value` instead.
    - `monitors` SLOHistoryMonitor[] — For multi-monitor SLOs, this represents SLI data for specific monitors. This is not included in the responses for `metric` based SLOs.
      - `error_budget_remaining` SLOErrorBudgetRemainingData — A mapping of threshold `timeframe` to the remaining error budget.
      - `errors` SLOHistoryResponseErrorWithType[] — An array of error objects returned while querying the history data for the service level objective.
        - `error_message` string, required — A message with more details about the error.
        - `error_type` string, required — Type of the error.
      - `group` string — For groups in a grouped SLO, this is the group name.
      - `history` array[] — The state transition history for the monitor. It is represented as an array of pairs. Each pair is an array containing the timestamp of the transition as an integer in Unix epoch format in the first element, and the state as an integer in the second element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data. Periods of no data are counted either as uptime or downtime depending on monitor settings. See [SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data) for detailed information.
        - number[] — Represents an array timeseries data.
      - `monitor_modified` integer — For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor.
      - `monitor_type` string — For `monitor` based SLOs, this describes the type of monitor.
      - `name` string — For groups in a grouped SLO, this is the group name. For monitors in a multi-monitor SLO, this is the monitor name.
      - `precision` number, double — The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp. Use `span_precision` instead.
      - `preview` boolean — For `monitor` based SLOs, when `true` this indicates that a replay is in progress to give an accurate uptime calculation.
      - `sli_value` number, double, nullable — The current SLI value of the SLO over the history window.
      - `span_precision` number, double — The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp.
      - `uptime` number, double — Use `sli_value` instead.
    - `overall` SLOHistorySLIData — An object that holds an SLI value and its associated data. It can represent an SLO's overall SLI value. This can also represent the SLI value for a specific monitor in multi-monitor SLOs, or a group in grouped SLOs.
      - `error_budget_remaining` SLOErrorBudgetRemainingData — A mapping of threshold `timeframe` to the remaining error budget.
      - `errors` SLOHistoryResponseErrorWithType[] — An array of error objects returned while querying the history data for the service level objective.
        - `error_message` string, required — A message with more details about the error.
        - `error_type` string, required — Type of the error.
      - `group` string — For groups in a grouped SLO, this is the group name.
      - `history` array[] — The state transition history for `monitor` or `time-slice` SLOs. It is represented as an array of pairs. Each pair is an array containing the timestamp of the transition as an integer in Unix epoch format in the first element, and the state as an integer in the second element. An integer value of `0` for state means uptime, `1` means downtime, and `2` means no data. Periods of no data count as uptime in time-slice SLOs, while for monitor SLOs, no data is counted either as uptime or downtime depending on monitor settings. See [SLO documentation](https://docs.datadoghq.com/service_management/service_level_objectives/monitor/#missing-data) for detailed information.
        - number[] — Represents an array timeseries data.
      - `monitor_modified` integer — For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor.
      - `monitor_type` string — For `monitor` based SLOs, this describes the type of monitor.
      - `name` string — For groups in a grouped SLO, this is the group name. For monitors in a multi-monitor SLO, this is the monitor name.
      - `precision` object — A mapping of threshold `timeframe` to number of accurate decimals, regardless of the from && to timestamp.
      - `preview` boolean — For `monitor` based SLOs, when `true` this indicates that a replay is in progress to give an accurate uptime calculation.
      - `sli_value` number, double, nullable — The current SLI value of the SLO over the history window.
      - `span_precision` number, double — The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp.
      - `uptime` number, double, nullable — Use `sli_value` instead.
    - `series` SLOHistoryMetrics — A `metric` based SLO history response. This is not included in responses for `monitor` based SLOs.
      - `denominator` SLOHistoryMetricsSeries, required — A representation of `metric` based SLO timeseries for the provided queries. This is the same response type from `batch_query` endpoint.
        - `count` integer, required — Count of submitted metrics.
        - `metadata` SLOHistoryMetricsSeriesMetadata — Query metadata.
          - `aggr` string — Query aggregator function.
          - `expression` string — Query expression.
          - `metric` string — Query metric used.
          - `query_index` integer — Query index from original combined query.
          - `scope` string — Query scope.
          - `unit` SLOHistoryMetricsSeriesMetadataUnit[], nullable — An array of metric units that contains up to two unit objects. For example, bytes represents one unit object and bytes per second represents two unit objects. If a metric query only has one unit object, the second array element is null.
            - `family` string — The family of metric unit, for example `bytes` is the family for `kibibyte`, `byte`, and `bit` units.
            - `id` integer — The ID of the metric unit.
            - `name` string — The unit of the metric, for instance `byte`.
            - `plural` string, nullable — The plural Unit of metric, for instance `bytes`.
            - `scale_factor` number, double — The scale factor of metric unit, for instance `1.0`.
            - `short_name` string, nullable — A shorter and abbreviated version of the metric unit, for instance `B`.
        - `sum` number, double, required — Total sum of the query.
        - `values` number[], required — The query values for each metric.
      - `interval` integer, required — The aggregated query interval for the series data. It's implicit based on the query time window.
      - `message` string — Optional message if there are specific query issues/warnings.
      - `numerator` SLOHistoryMetricsSeries, required — A representation of `metric` based SLO timeseries for the provided queries. This is the same response type from `batch_query` endpoint.
        - `count` integer, required — Count of submitted metrics.
        - `metadata` SLOHistoryMetricsSeriesMetadata — Query metadata.
          - `aggr` string — Query aggregator function.
          - `expression` string — Query expression.
          - `metric` string — Query metric used.
          - `query_index` integer — Query index from original combined query.
          - `scope` string — Query scope.
          - `unit` SLOHistoryMetricsSeriesMetadataUnit[], nullable — An array of metric units that contains up to two unit objects. For example, bytes represents one unit object and bytes per second represents two unit objects. If a metric query only has one unit object, the second array element is null.
            - `family` string — The family of metric unit, for example `bytes` is the family for `kibibyte`, `byte`, and `bit` units.
            - `id` integer — The ID of the metric unit.
            - `name` string — The unit of the metric, for instance `byte`.
            - `plural` string, nullable — The plural Unit of metric, for instance `bytes`.
            - `scale_factor` number, double — The scale factor of metric unit, for instance `1.0`.
            - `short_name` string, nullable — A shorter and abbreviated version of the metric unit, for instance `B`.
        - `sum` number, double, required — Total sum of the query.
        - `values` number[], required — The query values for each metric.
      - `query` string, required — The combined numerator and denominator query CSV.
      - `res_type` string, required — The series result type. This mimics `batch_query` response type.
      - `resp_version` integer, required — The series response version type. This mimics `batch_query` response type.
      - `times` number[], required — An array of query timestamps in EPOCH milliseconds.
    - `thresholds` object — mapping of string timeframe to the SLO threshold.
    - `to_ts` integer — The `to` timestamp in epoch seconds.
    - `type` 'metric' | 'monitor' | 'time_slice' — The type of the service level objective.
    - `type_id` 0 | 1 | 2 — A numeric representation of the type of the service level objective (`0` for monitor, `1` for metric). Always included in service level objective responses. Ignored in create/update requests.
  - `errors` SLOHistoryResponseError[], nullable — A list of errors while querying the history data for the service level objective.
    - `error` string — Human readable error.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v1.md) · [All operations](https://skmtc.net/datadog/apis/api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v1/revisions/ca5871004d26/schema)
