Skip to content

Batch Retrieve Daily Availability



POST /api/v1/slo/availability/list

Overview

Batch retrieve the daily availability of monitor-type SLOs in the Workspace to which the current API Key belongs. You can also query availability for a specified second-precision window in the same request. Metric-type SLOs are not supported by this API.

Body Request Parameters

Parameter Type Required Description
window object Optional second-precision time window, using the half-open interval [startTime, endTime), up to 604800 seconds. When configured, a window summary is added to each SLO result.
window.startTime integer Conditionally Required Required when window is configured. Window start time, Unix second timestamp.
window.endTime integer Conditionally Required Required when window is configured. Window end time, Unix second timestamp.
sloUUIDs array Y SLO UUID list, up to 100.
Allow empty: False
startDate string Y Start business date, format YYYY-MM-DD, inclusive.
Allow empty: False
endDate string Y End business date, format YYYY-MM-DD, inclusive.
Allow empty: False
timezone string Y IANA timezone, e.g. Asia/Shanghai
Allow empty: False
interval string Aggregation granularity, currently only supports 1d
Allow empty: False
Optional values: ['1d']

Additional Parameter Notes

  • window only supplements the precise-window summary and does not replace the required startDate, endDate, and timezone. The window must fall entirely within the business date range of the specified timezone, the end time must not be later than the current server time, and 0 < endTime - startTime <= 604800 must be satisfied.
  • Only non-deleted monitor-type SLOs in the current Workspace are supported; metric-type SLOs are rejected.

  • A single query can retrieve up to 100 SLOs, and the date range can contain at most 90 calendar days.

  • interval currently only supports 1d.
  • Each calendar day is determined by the requested timezone, and availability is calculated using the actual number of seconds in that calendar day.
  • Dates without metric data return availability=null, hasData=false, and level=unknown.
  • level returns normal, warning, critical, or unknown based on the SLO's goal/minGoal.

Request Example

curl 'https://openapi.truewatch.com/api/v1/slo/availability/list' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"sloUUIDs":["monitor_xxx"],"startDate":"2026-05-03","endDate":"2026-07-31","timezone":"Asia/Shanghai","interval":"1d"}'

Query a Precise Window in the Same Request

The following request keeps the business date and timezone, and adds a one-hour window for that day:

{
  "sloUUIDs": [
    "monitor_xxx"
  ],
  "startDate": "2026-07-31",
  "endDate": "2026-07-31",
  "timezone": "Asia/Shanghai",
  "interval": "1d",
  "window": {
    "startTime": 1785427200,
    "endTime": 1785430800
  }
}

On success, the response still returns the original content.data[*].points; when window is configured, each content.data[*] additionally returns:

Field Type Description
window.startTime / window.endTime integer Requested window start and end time in seconds; the end time is exclusive.
window.value number Window availability, ranging from 0 to 100, calculated based on the actual seconds in the window and the cumulative failure cost.
window.hasData boolean In the current implementation, this is true when the query succeeds; it cannot be used to determine whether raw samples exist.
window.dataState string In the current implementation, this returns complete on success; on query failure, the request returns an error.
window.updatedAt integer / null Timestamp of the last non-correction sample in the window, in seconds; null when there is no such sample.

When the window query succeeds but no cost sample exists, the availability is calculated as zero cost and returns value=100, hasData=true, and updatedAt=null; this differs from the response rule for daily points when data is missing. This object is not returned when window is not passed.

Response

{
    "code": 200,
    "content": {
        "data": [
            {
                "sloUUID": "monitor_xxx",
                "name": "Metrics",
                "status": 0,
                "goal": 99.9,
                "minGoal": 99.5,
                "tagInfo": [
                    {
                        "name": "site:cn1"
                    }
                ],
                "points": [
                    {
                        "date": "2026-07-31",
                        "availability": 99.98,
                        "level": "normal",
                        "hasData": true
                    }
                ]
            }
        ]
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-XXXX"
}