# Monitor availability

Returns availability summary for a specific monitor.

[endpoint]
base_url = "https://uptime.betterstack.com"
path = "/api/v2/monitors/{monitor_id}/sla"
description = "Returns availability summary for a specific monitor"
method = "GET"

[[path_param]]
name = "monitor_id"
description = "The ID of the monitor you want to get"
required = true
type = "string"

[[query_param]]
name = "from"
description = "Start date (e.g., 2021-01-26)"
required = false
type = "string"

[[query_param]]
name = "to"
description = "End date (e.g., 2021-01-27)"
required = false
type = "string"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = '''Returns the availability summary since the monitor was created or for the specified date range.

<br>

The values of `total_downtime`, `longest_incident`, and `average_incident` are in seconds'''
body = '''{
  "data": {
    "id": "258338",
    "type": "monitor_sla",
    "attributes": {
      "availability": 99.98,
      "total_downtime": 600,
      "number_of_incidents": 3,
      "longest_incident": 300,
      "average_incident": 200
    }
  }
}'''

[[response]]
status = 400
description = '''When the optional from and to dates are invalid (e.g., the start date is in the future or the end date is before the start date).
'''
body = '''{
  "errors": "The data range is invalid. The date format could not be parsed, the start time is in the future, or the end time is after the start time."
}'''
[/responses]

#### Example cURL 

```shell
[label Example]
curl --request GET \
  --url https://uptime.betterstack.com/api/v2/monitors/123456789/sla?from=2021-01-26&to=2021-01-27 \
  --header "Authorization: Bearer $TOKEN"
```

[info]
#### Looking for the details of a specific parameter?

Explore [the list of all monitor API parameters](https://betterstack.com/docs/uptime/api/monitors-api-response-params/)
[/info]