# List monitors

Returns list of all your monitors.

[endpoint]
base_url = "https://incidents.betterstack.com"
path = "/api/v2/monitors"
method = "GET"

[[query_param]]
name = "team_name"
description = "Filter monitors belonging to a specified team when using [global API token](https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-a-global-api-token)."
required = false
type = "string"

[[query_param]]
name = "url"
description = "Filter monitors by their URL property."
required = false
type = "string"

[[query_param]]
name = "pronounceable_name"
description = "Filter monitors by their pronounceable name property."
required = false
type = "string"

[[query_param]]
name = "page"
description = "The page number to return, starting with `1`."
required = false
type = "integer"

[[query_param]]
name = "per_page"
description = "Number of results per page. Defaults to `50`, maximum `250`."
required = false
type = "integer"

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

[responses]
[[response]]
status = 200
description = '''Returns list of existing monitors.'''
body = '''{
  "data": [
    {
      "id": "2",
      "type": "monitor",
      "attributes": {
        "url": "https://uptime.betterstack.com",
        "pronounceable_name": "Uptime homepage",
        "auth_username": null,
        "auth_password": null,
        "monitor_type": "keyword",
        "monitor_group_id": 12345,
        "last_checked_at": "2020-09-01T14:17:46.000Z",
        "status": "up",
        "policy_id": null,
        "expiration_policy_id": null,
        "team_name": "Test team",
        "required_keyword": "We call you",
        "verify_ssl": true,
        "check_frequency": 30,
        "effective_check_frequency": 30,
        "effective_check_frequency_reason": null,
        "call": true,
        "sms": true,
        "email": true,
        "push": true,
        "critical_alert": false,
        "team_wait": null,
        "http_method": "get",
        "request_timeout": 15,
        "recovery_period": 0,
        "request_headers": [
          {
            "id": "123",
            "name": "Content-Type",
            "value": "application/xml"
          }
        ],
        "request_body": "",
        "follow_redirects": true,
        "remember_cookies": true,
        "paused_at": null,
        "created_at": "2020-02-18T13:38:16.586Z",
        "updated_at": "2020-09-08T13:10:20.202Z",
        "ssl_expiration": 7,
        "domain_expiration": 14,
        "regions": ["us", "eu", "as", "au"],
        "maintenance_from": "01:02:00",
        "maintenance_to": "03:04:00",
        "maintenance_timezone": "Amsterdam",
        "maintenance_days": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"],
        "port": null,
        "confirmation_period": 120,
        "expected_status_codes": [],
        "environment_variables": {},
        "proxy_host": null,
        "proxy_port": null,
        "paused": false,
        "playwright_script": null,
        "ip_version": null,
        "checks_version": "v2"
      },
      "relationships": {
        "policy": {
          "data": null
        },
        "expiration_policy": {
          "data": null
        }
      }
    }
  ],
  "pagination": {
    "first": "https://incidents.betterstack.com/api/v2/monitors?page=1",
    "last": "https://incidents.betterstack.com/api/v2/monitors?page=16",
    "prev": null,
    "next": "https://incidents.betterstack.com/api/v2/monitors?page=2"
  }
}'''

[/responses]

[params]
title = "Response attributes"

[[param]]
name = "id"
type = "string"
description = "The ID of the monitor."

[[param]]
name = "type"
type = "string"
description = "Always `monitor`."

[[param]]
name = "attributes.url"
type = "string"
description = "The URL of your website, or the host for Server and Port monitors. For `playwright` monitors, the scenario name."

[[param]]
name = "attributes.pronounceable_name"
type = "string"
description = "The name of the monitor, or its URL without the scheme when none is set. We use it when we call you."

[[param]]
name = "attributes.monitor_type"
type = "string"
description = "What the monitor checks: `status`, `expected_status_code`, `keyword`, `keyword_absence`, `ping`, `tcp`, `udp`, `smtp`, `pop`, `imap`, `dns`, or `playwright`. [Create a monitor](https://betterstack.com/docs/uptime/api/create-a-new-monitor/) describes each type."

[[param]]
name = "attributes.monitor_group_id"
type = "integer or null"
description = "The ID of the monitor group the monitor is in, or `null` when it's in no group."

[[param]]
name = "attributes.last_checked_at"
type = "string or null"
description = "When the last check ran, in ISO 8601 format."

[[param]]
name = "attributes.status"
type = "string"
description = "`up` when checks are passing, `down` when they are failing, `validating` when the service seems back up but the `recovery_period` since the last failed check hasn't passed yet, `paused` when the monitor was paused, `pending` when it was just created and waits for the first check, or `maintenance` when it's in its maintenance window."

[[param]]
name = "attributes.policy_id"
type = "string or null"
description = "The ID of the escalation policy for the monitor. When it's set, the `call`, `sms`, `email`, and `push` settings are ignored."

[[param]]
name = "attributes.expiration_policy_id"
type = "integer or null"
description = "The ID of the escalation policy for SSL certificate and domain expiration alerts. `null` means we send an e-mail to the entire team."

[[param]]
name = "attributes.team_name"
type = "string"
description = "The team the monitor is in."

[[param]]
name = "attributes.required_keyword"
type = "string or null"
description = "The keyword that `keyword`, `keyword_absence`, and `udp` monitors look for."

[[param]]
name = "attributes.verify_ssl"
type = "boolean"
description = "Whether we verify the SSL certificate."

[[param]]
name = "attributes.call"
type = "boolean"
description = "Whether we call the on-call person."

[[param]]
name = "attributes.sms"
type = "boolean"
description = "Whether we send an SMS to the on-call person."

[[param]]
name = "attributes.email"
type = "boolean"
description = "Whether we send an e-mail to the on-call person."

[[param]]
name = "attributes.push"
type = "boolean"
description = "Whether we send a push notification to the on-call person."

[[param]]
name = "attributes.critical_alert"
type = "boolean"
description = "Whether we send a critical push notification that ignores the mute switch and Do Not Disturb mode."

[[param]]
name = "attributes.team_wait"
type = "integer or null"
description = "How long to wait before escalating the incident to the whole team, in seconds. `null` means we don't escalate to the team."

[[param]]
name = "attributes.http_method"
type = "string"
description = "The HTTP method of the request, in lowercase: `get`, `head`, `post`, `put`, `patch`, or `options`."

[[param]]
name = "attributes.request_timeout"
type = "integer"
description = "How long we wait before the request times out. In milliseconds for `ping`, `tcp`, `udp`, `smtp`, `pop`, `imap`, and `dns` monitors, in seconds for other types. For `playwright` monitors, the scenario timeout in seconds."

[[param]]
name = "attributes.recovery_period"
type = "integer"
description = "How long the monitor must be up before we resolve an incident automatically, in seconds."

[[param]]
name = "attributes.check_frequency"
type = "integer"
description = "How often you set the monitor to be checked, in seconds."

[[param]]
name = "attributes.effective_check_frequency"
type = "integer"
description = "How often we actually check the monitor, in seconds. It's longer than `check_frequency` when `effective_check_frequency_reason` is set."

[[param]]
name = "attributes.effective_check_frequency_reason"
type = "string or null"
description = "Why `effective_check_frequency` differs from `check_frequency`: `slowed_down` while we temporarily check less often after repeated `429` responses or timeouts, `plan_minimum` when your plan's shortest check frequency is longer, or `request_timeout` when the timeout is longer. `null` when both are the same."

[[param]]
name = "attributes.request_headers"
type = "array of objects"
description = "Custom HTTP headers we send with the check."

[[param]]
name = "attributes.request_headers[].id"
type = "string"
description = "The ID of the header. Send it on update to change or remove this header."

[[param]]
name = "attributes.request_headers[].name"
type = "string"
description = "The name of the header, like `Content-Type`."

[[param]]
name = "attributes.request_headers[].value"
type = "string"
description = "The value of the header, like `application/json`."

[[param]]
name = "attributes.request_body"
type = "string or null"
description = "The body of the request. For `dns` monitors, the domain to query."

[[param]]
name = "attributes.auth_username"
type = "string or null"
description = "The basic HTTP authentication username."

[[param]]
name = "attributes.auth_password"
type = "string or null"
description = "The basic HTTP authentication password."

[[param]]
name = "attributes.follow_redirects"
type = "boolean"
description = "Whether we follow redirects."

[[param]]
name = "attributes.remember_cookies"
type = "boolean"
description = "Whether we keep cookies when following redirects."

[[param]]
name = "attributes.paused"
type = "boolean"
description = "Whether the monitor is paused."

[[param]]
name = "attributes.paused_at"
type = "string or null"
description = "When the monitor was paused, in ISO 8601 format, or `null` when it isn't paused."

[[param]]
name = "attributes.created_at"
type = "string"
description = "When the monitor was created, in ISO 8601 format."

[[param]]
name = "attributes.updated_at"
type = "string"
description = "When the monitor was last updated, in ISO 8601 format."

[[param]]
name = "attributes.ssl_expiration"
type = "integer or null"
description = "How many days before the SSL certificate expires we alert you: `1`, `2`, `3`, `7`, `14`, `30`, or `60`. `null` means we don't check it."

[[param]]
name = "attributes.domain_expiration"
type = "integer or null"
description = "How many days before the domain expires we alert you: `1`, `2`, `3`, `7`, `14`, `30`, or `60`. `null` means we don't check it."

[[param]]
name = "attributes.regions"
type = "array of strings"
description = "The regions we check from, any of `us`, `eu`, `as`, `au`. Lists every region when none were set."

[[param]]
name = "attributes.port"
type = "string or null"
description = "The port for `tcp`, `udp`, `smtp`, `pop`, and `imap` monitors. Several ports are separated by commas, like `25,465,587`."

[[param]]
name = "attributes.confirmation_period"
type = "integer"
description = "How long we wait after observing a failure before we start an incident, in seconds."

[[param]]
name = "attributes.expected_status_codes"
type = "array of integers"
description = "The HTTP status codes that count as up for `expected_status_code` monitors."

[[param]]
name = "attributes.maintenance_from"
type = "string or null"
description = "Start of the daily maintenance window when we don't check, like `01:00:00`, or `null` when no window is set."

[[param]]
name = "attributes.maintenance_to"
type = "string or null"
description = "End of the daily maintenance window, like `03:00:00`, or `null` when no window is set."

[[param]]
name = "attributes.maintenance_timezone"
type = "string or null"
description = "The time zone of the maintenance window, as a [Rails time zone name](https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html) like `Amsterdam`. `null` means UTC."

[[param]]
name = "attributes.maintenance_days"
type = "array of strings"
description = "The days the maintenance window applies to, any of `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`. Lists every day when none were set."

[[param]]
name = "attributes.environment_variables"
type = "object"
description = "The environment variables of a `playwright` scenario, as name and value pairs."

[[param]]
name = "attributes.playwright_script"
type = "string or null"
description = "The JavaScript source code of the scenario for `playwright` monitors."

[[param]]
name = "attributes.scenario_name"
type = "string"
description = "The scenario name identifying the monitor in the UI. Returned only for `playwright` monitors."

[[param]]
name = "attributes.proxy_host"
type = "string or null"
description = "The host of the proxy server we send the check through, which can include credentials like `user:pass@proxy.example.com`."

[[param]]
name = "attributes.proxy_port"
type = "integer or null"
description = "The port of the proxy server."

[[param]]
name = "attributes.ip_version"
type = "string or null"
description = "`ipv4` or `ipv6` when we use only that IP version, or `null` when we use both."

[[param]]
name = "attributes.checks_version"
type = "string"
description = "Always `v2`. Kept for backward compatibility."

[[param]]
name = "relationships.policy.data"
type = "object or null"
description = "The escalation policy of the monitor as `id` and `type`, where `type` is `policy`, or `null` when none is set."

[[param]]
name = "relationships.expiration_policy.data"
type = "object or null"
description = "The escalation policy for SSL certificate and domain expiration alerts as `id` and `type`, where `type` is `policy`, or `null` when none is set."

[[param]]
name = "pagination.first"
type = "string"
description = "The URL of the first page. Read more about [pagination](https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#pagination)."

[[param]]
name = "pagination.last"
type = "string"
description = "The URL of the last page."

[[param]]
name = "pagination.prev"
type = "string or null"
description = "The URL of the previous page, or `null` on the first page."

[[param]]
name = "pagination.next"
type = "string or null"
description = "The URL of the next page, or `null` on the last page."
[/params]

<br>

#### Example cURL 

[code-tabs]
```shell
[label List all]
curl --request GET \
  --url "https://incidents.betterstack.com/api/v2/monitors" \
  --header "Authorization: Bearer $TOKEN"
```
```shell
[label Filter by URL]
curl --request GET \
  --url "https://incidents.betterstack.com/api/v2/monitors?url=https://google.com" \
  --header "Authorization: Bearer $TOKEN"
```
[/code-tabs]

[info]
### Don't have your API token yet?
Please, see [obtaining an API token](https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/).
[/info]
