Create a monitor

Create a monitor. For HTTP checks, pass the full URL. For ping, tcp, udp, smtp, pop, imap and dns monitors, url is the bare host, such as example.com. Playwright monitors accept scenario_name and playwright_script instead of url.

POST https://incidents.betterstack.com/api/v3/monitors
team_id string

Team to use, such as t123. Get the ID via List teams. Required when you can access more than one team.

Authorization string required

Bearer $TOKEN

Content-Type string

application/json

url string or null

The URL of your website, or the host to check for ping, tcp, udp, smtp, pop, imap and dns monitors, without a protocol. null on playwright monitors. Required for every type except playwright, which accepts scenario_name instead.

monitor_type string default: status

What the monitor checks.
Valid values:
status: Checks that the URL returns a 2XX status code.
expected_status_code: Checks that the URL returns one of expected_status_codes.
keyword: Checks that the page contains required_keyword.
keyword_absence: Checks that the page doesn't contain required_keyword.
ping: Pings the host in url.
tcp: Checks that a TCP port on the host accepts connections.
udp: Sends request_body to a UDP port on the host and checks that the answer contains required_keyword.
smtp: Checks for an SMTP server on the host at port.
pop: Checks for a POP3 server on the host at port.
imap: Checks for an IMAP server on the host at port.
dns: Checks that the DNS server on the host answers a query for the domain in request_body.
playwright: Runs the scenario in playwright_script.

pronounceable_name string

The name of the monitor, which we use when we call you.

monitor_group_id string or null

ID of the monitor group this monitor belongs to.

paused boolean default: false

Whether the monitor is paused. A paused monitor opens no incidents and sends no alerts. Send true to pause it or false to resume it.

check_frequency integer default: 180

How often to check, in seconds. Must be at least the request_timeout. A new or changed value below the plan's shortest interval is refused with a 422. A value the monitor already has, such as one set before a plan change, can still be sent. Accepted values depend on monitor_type.
playwright: accepts 60, 180, 300, 600, 900, 1800, 3600, 21600, 43200 or 86400.
Every other type: accepts 30, 45, 60, 120, 180, 300, 600, 900 or 1800.

request_timeout integer

How long a check waits before it times out. The unit and accepted values depend on monitor_type.
status, expected_status_code, keyword and keyword_absence: in seconds, accepts 2, 3, 5, 10, 15, 30, 45, 60, 90, 120 or 180 and defaults to 30.
ping, tcp, udp, smtp, pop, imap and dns: in milliseconds, accepts 500, 1000, 2000, 3000 or 5000 and defaults to 5000.
playwright: in seconds, accepts 15, 30, 45, 60, 120, 180, 240, 300, 360, 480, 600 or 900 and defaults to 30.

recovery_period integer default: 180

How long checks must keep passing before the incident resolves, in seconds. Possible values: 0, 60, 180, 300, 900, 1800, 3600, 7200.

confirmation_period integer default: 0

How long to wait after a failure before starting an incident, in seconds, from 0 to 86400.

required_keyword string or null

The keyword to look for. Required for keyword, keyword_absence and udp monitors.

http_method string default: get

The HTTP method of the request. Accepts get, head, post, put, patch or options. Responses return the method in lowercase. head can't be used with keyword or keyword_absence monitors.

request_body string or null

The body of the request. A dns monitor requires it. Set it to the domain to query. A udp monitor sends it as its content. Must be empty for get, head and options requests.

request_headers array of objects

Custom request headers, as a list of {name, value} objects. A list replaces all headers, and an empty list removes them all.

request_headers[].name string

The header name, like Content-Type.

request_headers[].value string

The header value, like application/json.

expected_status_codes array of integers default: []

HTTP status codes from 100 to 599 that count as up. A 3xx code needs follow_redirects set to false. Required for expected_status_code monitors.

follow_redirects boolean default: true

Whether we follow HTTP redirects.

remember_cookies boolean default: true

Whether we keep cookies when redirecting.

verify_ssl boolean default: true

Whether a check fails on an invalid SSL certificate.

auth_username string or null

HTTP basic-auth username. null when none is set. Sending null doesn't remove a stored value.

auth_password string or null

HTTP basic-auth password. Not returned after it's saved. Sending null doesn't remove a stored value.

regions array of strings

Regions to check from, as any combination of us, eu, as and au. When none are set, we check from all regions. Responses then list all of them.

ip_version string or null

The IP version to check over. null checks over both IPv4 and IPv6.
Valid values:
ipv4: Checks over IPv4 only.
ipv6: Checks over IPv6 only.

port string or null

The port to check. tcp and udp accept one port. smtp accepts 25, 465 or 587, pop accepts 110 or 995, and imap accepts 143 or 993, with several separated by commas like 25,465,587. Required for tcp, udp, smtp, pop and imap monitors.

proxy_host string or null

The host of the proxy server we send the check through, without a protocol. Can include credentials, like user:pass@proxy.example.com. Only for status, expected_status_code, keyword and keyword_absence monitors.

proxy_port integer or null

The port of the proxy server, from 1 to 65535. Requires proxy_host.

email boolean default: true

Whether to send an e-mail to the on-call person. Ignored while an escalation policy is set.

sms boolean default: false

Whether to send an SMS to the on-call person. Ignored while an escalation policy is set.

call boolean default: false

Whether to call the on-call person. Ignored while an escalation policy is set.

push boolean default: false

Whether to send a push notification to the on-call person. Ignored while an escalation policy is set.

critical_alert boolean default: false

Whether to send a critical push notification that ignores the mute switch and Do Not Disturb mode. Ignored while an escalation policy is set.

team_wait integer or null

Seconds to wait before escalating to the whole team. 0 alerts the whole team right away, and null never escalates to the team. Ignored while an escalation policy is set.

escalation_policy_id string or null

ID of the escalation policy for alerts, or null to alert the current on-call person directly.

expiration_escalation_policy_id string or null

ID of the escalation policy for alerts about expiring SSL certificates and domains. Monitors of the same domain share this setting, subdomains included. For example, monitors of example.com and www.example.com share it. A value set on one monitor is copied to all of them, so set the same value on each.

ssl_expiration integer or null

How many days before the SSL certificate expires we alert you. null turns the check off and is the default. Monitors of exactly the same domain share this setting, not its subdomains. For example, monitors of example.com/a and example.com/b share it, while www.example.com has its own. A value set on one monitor is copied to all of them, so set the same value on each. Possible values: 1, 2, 3, 7, 14, 30, 60.

domain_expiration integer or null

How many days before the domain expires we alert you. null turns the check off and is the default. Monitors of the same domain share this setting, subdomains included. For example, monitors of example.com and www.example.com share it. A value set on one monitor is copied to all of them, so set the same value on each. Possible values: 1, 2, 3, 7, 14, 30, 60.

maintenance_from string or null

Start of the daily maintenance window, when we don't check, as HH:MM:SS, like 01:00:00. null when no window is set.

maintenance_to string or null

End of the daily maintenance window, as HH:MM:SS, like 03:00:00. Required with maintenance_from. null when no window is set.

maintenance_timezone string or null default: UTC

The time zone of the maintenance window, as a Rails time zone name like Amsterdam or its IANA ID like Europe/Amsterdam. null when it isn't set, which works as UTC.

maintenance_days array of strings default: ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]

Days of the week the maintenance window applies to, any of mon, tue, wed, thu, fri, sat and sun. An overnight window belongs to the day it starts. Order doesn't matter.

playwright_script string or null

The JavaScript source of the scenario, for playwright monitors.

scenario_name string

The name of a playwright monitor's scenario. Required for playwright monitors, and returned only for them.

environment_variables object

Environment variables the playwright scenario can use, as name and value pairs like {"PASSWORD": "passw0rd"}. Responses return each name with a null value. An object you send replaces all of them, and a name sent with null keeps its saved value. To add one, send the saved names with null and the new name with its value. Keys are yours to choose. Each value is a string, or null to keep the saved value.

metadata object

Custom metadata. Each key holds a list of values. A value is a string, written as {type: "String", value}, or a catalog reference, written as {type, item_id, name, email}. User references are returned as u123 and team references as t123. Get a user's ID via List team members, and a team's ID via List teams. Values under one key must all be the same type and can't repeat.

metadata.<key>[].type string

String, or the type of the referenced item, which is one of User, Team, EscalationPolicy, OnCallSchedule, Monitor, SlackIntegration, LinearIntegration, JiraIntegration, MicrosoftTeamsIntegration, ZapierZap, OutgoingWebhook, PagerDutyIntegration or Source.

metadata.<key>[].value string

The text of a String value.

metadata.<key>[].item_id string

ID of the referenced item. For a user it's u123 or their e-mail. For a team it's t123, and for any other item it's the item's own ID. Responses return users and teams in this form. Get a user's ID via List team members, and a team's ID via List teams.

metadata.<key>[].name string or null

Referenced item's name, or null when the item has no name or no longer exists. An item can also be found by its name instead of item_id.

metadata.<key>[].email string

Referenced user's e-mail, returned for a User. A user can also be found by e-mail.

201 Created
{
  "data": {
    "id": "123456789",
    "type": "monitor",
    "attributes": {
      "url": "https://facebook.com",
      "monitor_type": "status",
      "pronounceable_name": "Facebook homepage",
      "monitor_group_id": "12345",
      "paused": false,
      "check_frequency": 30,
      "effective_check_frequency": 60,
      "effective_check_frequency_reason": "slowed_down",
      "request_timeout": 15,
      "recovery_period": 0,
      "confirmation_period": 120,
      "required_keyword": "We call you",
      "http_method": "get",
      "request_body": "{\"query\": \"health\"}",
      "request_headers": [
        {
          "name": "X-Custom-Header",
          "value": "custom header value"
        }
      ],
      "expected_status_codes": [
        200,
        201
      ],
      "follow_redirects": true,
      "remember_cookies": true,
      "verify_ssl": true,
      "auth_username": "basic-auth-user",
      "regions": [
        "us",
        "eu",
        "as",
        "au"
      ],
      "ip_version": "ipv4",
      "port": "25,465,587",
      "proxy_host": "proxy.example.com",
      "proxy_port": 8080,
      "email": true,
      "sms": true,
      "call": true,
      "push": true,
      "critical_alert": false,
      "team_wait": 180,
      "escalation_policy_id": "12345",
      "expiration_escalation_policy_id": "12345",
      "ssl_expiration": 7,
      "domain_expiration": 14,
      "maintenance_from": "01:02:00",
      "maintenance_to": "03:04:00",
      "maintenance_timezone": "Amsterdam",
      "maintenance_days": [
        "mon",
        "tue",
        "wed",
        "thu",
        "fri",
        "sat",
        "sun"
      ],
      "playwright_script": "import { test, expect } from '@playwright/test';\n\ntest('has title', async ({ page }) => {\n  await page.goto('https://betterstack.com/')\n  await expect(page).toHaveTitle(/Better Stack/)\n});\n",
      "scenario_name": "Better Stack homepage title",
      "environment_variables": {
        "PASSWORD": null
      },
      "status": "up",
      "last_checked_at": "2020-09-01T14:17:46.000Z",
      "paused_at": "2020-09-08T13:10:20.000Z",
      "checks_version": "v2",
      "created_at": "2020-02-18T13:38:16.586Z",
      "updated_at": "2020-09-08T13:10:20.202Z",
      "team_id": "t123",
      "team_name": "Production",
      "metadata": {
        "Service": [
          {
            "type": "String",
            "value": "Checkout"
          }
        ]
      }
    },
    "relationships": {
      "escalation_policy": {
        "data": {
          "id": "12345",
          "type": "escalation_policy"
        }
      },
      "expiration_escalation_policy": {
        "data": {
          "id": "12345",
          "type": "escalation_policy"
        }
      }
    }
  }
}

Returns the newly created monitor.

id string

The ID of the monitor.

type string

Always monitor.

url string or null

The URL of your website, or the host to check for ping, tcp, udp, smtp, pop, imap and dns monitors, without a protocol. null on playwright monitors.

monitor_type string

What the monitor checks.
Valid values:
status: Checks that the URL returns a 2XX status code.
expected_status_code: Checks that the URL returns one of expected_status_codes.
keyword: Checks that the page contains required_keyword.
keyword_absence: Checks that the page doesn't contain required_keyword.
ping: Pings the host in url.
tcp: Checks that a TCP port on the host accepts connections.
udp: Sends request_body to a UDP port on the host and checks that the answer contains required_keyword.
smtp: Checks for an SMTP server on the host at port.
pop: Checks for a POP3 server on the host at port.
imap: Checks for an IMAP server on the host at port.
dns: Checks that the DNS server on the host answers a query for the domain in request_body.
playwright: Runs the scenario in playwright_script.

pronounceable_name string

The name of the monitor, which we use when we call you.

monitor_group_id string or null

ID of the monitor group this monitor belongs to.

paused boolean

Whether the monitor is paused. A paused monitor opens no incidents and sends no alerts.

check_frequency integer

How often to check, in seconds. Must be at least the request_timeout. A new or changed value below the plan's shortest interval is refused with a 422. A value the monitor already has, such as one set before a plan change, can still be sent. Accepted values depend on monitor_type.
playwright: accepts 60, 180, 300, 600, 900, 1800, 3600, 21600, 43200 or 86400.
Every other type: accepts 30, 45, 60, 120, 180, 300, 600, 900 or 1800.

effective_check_frequency integer

How often the monitor actually checks, in seconds. effective_check_frequency_reason says why it differs from check_frequency.

effective_check_frequency_reason string or null

Why effective_check_frequency differs from check_frequency. null when they're the same.
Valid values:
slowed_down: We check less often after repeated 429 responses or timeouts.
plan_minimum: Your plan's shortest interval between checks is longer than check_frequency, which was saved before the plan changed.
request_timeout: The monitor's request_timeout is longer than check_frequency.

request_timeout integer

How long a check waits before it times out. The unit and accepted values depend on monitor_type.
status, expected_status_code, keyword and keyword_absence: in seconds, accepts 2, 3, 5, 10, 15, 30, 45, 60, 90, 120 or 180 and defaults to 30.
ping, tcp, udp, smtp, pop, imap and dns: in milliseconds, accepts 500, 1000, 2000, 3000 or 5000 and defaults to 5000.
playwright: in seconds, accepts 15, 30, 45, 60, 120, 180, 240, 300, 360, 480, 600 or 900 and defaults to 30.

recovery_period integer

How long checks must keep passing before the incident resolves, in seconds. Possible values: 0, 60, 180, 300, 900, 1800, 3600, 7200.

confirmation_period integer

How long to wait after a failure before starting an incident, in seconds, from 0 to 86400.

required_keyword string or null

The keyword to look for.

http_method string

The HTTP method of the request. Accepts get, head, post, put, patch or options. Responses return the method in lowercase. head can't be used with keyword or keyword_absence monitors.

request_body string or null

The body of the request. A dns monitor requires it. Set it to the domain to query. A udp monitor sends it as its content.

request_headers array of objects

Custom request headers, as a list of {name, value} objects. A list replaces all headers, and an empty list removes them all.

request_headers[].id string

The header's ID.

request_headers[].name string

The header name, like Content-Type.

request_headers[].value string

The header value, like application/json.

expected_status_codes array of integers

HTTP status codes from 100 to 599 that count as up. A 3xx code needs follow_redirects set to false.

follow_redirects boolean

Whether we follow HTTP redirects.

remember_cookies boolean

Whether we keep cookies when redirecting.

verify_ssl boolean

Whether a check fails on an invalid SSL certificate.

auth_username string or null

HTTP basic-auth username. null when none is set.

regions array of strings

Regions to check from, as any combination of us, eu, as and au. When none are set, we check from all regions. Responses then list all of them.

ip_version string or null

The IP version to check over. null checks over both IPv4 and IPv6.
Valid values:
ipv4: Checks over IPv4 only.
ipv6: Checks over IPv6 only.

port string or null

The port to check. tcp and udp accept one port. smtp accepts 25, 465 or 587, pop accepts 110 or 995, and imap accepts 143 or 993, with several separated by commas like 25,465,587.

proxy_host string or null

The host of the proxy server we send the check through, without a protocol. Can include credentials, like user:pass@proxy.example.com. Only for status, expected_status_code, keyword and keyword_absence monitors.

proxy_port integer or null

The port of the proxy server, from 1 to 65535. Requires proxy_host.

email boolean

Whether to send an e-mail to the on-call person. Ignored while an escalation policy is set.

sms boolean

Whether to send an SMS to the on-call person. Ignored while an escalation policy is set.

call boolean

Whether to call the on-call person. Ignored while an escalation policy is set.

push boolean

Whether to send a push notification to the on-call person. Ignored while an escalation policy is set.

critical_alert boolean

Whether to send a critical push notification that ignores the mute switch and Do Not Disturb mode. Ignored while an escalation policy is set.

team_wait integer or null

Seconds to wait before escalating to the whole team. 0 alerts the whole team right away, and null never escalates to the team. Ignored while an escalation policy is set.

escalation_policy_id string or null

ID of the escalation policy for alerts, or null to alert the current on-call person directly.

expiration_escalation_policy_id string or null

ID of the escalation policy for alerts about expiring SSL certificates and domains. Monitors of the same domain share this setting, subdomains included. For example, monitors of example.com and www.example.com share it. A value set on one monitor is copied to all of them, so set the same value on each.

relationships.escalation_policy.data object or null

The escalation policy used for alerts, linked by its ID. Names the same policy as escalation_policy_id. null when the monitor has none.

relationships.escalation_policy.data.id string

ID of the linked escalation policy.

relationships.escalation_policy.data.type string

Always escalation_policy.

relationships.expiration_escalation_policy.data object or null

The escalation policy for alerts about expiring SSL certificates and domains, linked by its ID. Names the same policy as expiration_escalation_policy_id. null when the monitor has none.

relationships.expiration_escalation_policy.data.id string

ID of the linked escalation policy.

relationships.expiration_escalation_policy.data.type string

Always escalation_policy.

ssl_expiration integer or null

How many days before the SSL certificate expires we alert you. null turns the check off and is the default. Monitors of exactly the same domain share this setting, not its subdomains. For example, monitors of example.com/a and example.com/b share it, while www.example.com has its own. A value set on one monitor is copied to all of them, so set the same value on each. Possible values: 1, 2, 3, 7, 14, 30, 60.

domain_expiration integer or null

How many days before the domain expires we alert you. null turns the check off and is the default. Monitors of the same domain share this setting, subdomains included. For example, monitors of example.com and www.example.com share it. A value set on one monitor is copied to all of them, so set the same value on each. Possible values: 1, 2, 3, 7, 14, 30, 60.

maintenance_from string or null

Start of the daily maintenance window, when we don't check, as HH:MM:SS, like 01:00:00. null when no window is set.

maintenance_to string or null

End of the daily maintenance window, as HH:MM:SS, like 03:00:00. Required with maintenance_from. null when no window is set.

maintenance_timezone string or null

The time zone of the maintenance window, as a Rails time zone name like Amsterdam or its IANA ID like Europe/Amsterdam. null when it isn't set, which works as UTC.

maintenance_days array of strings

Days of the week the maintenance window applies to, any of mon, tue, wed, thu, fri, sat and sun. An overnight window belongs to the day it starts. Order doesn't matter.

playwright_script string or null

The JavaScript source of the scenario, for playwright monitors.

scenario_name string

The name of a playwright monitor's scenario. Required for playwright monitors, and returned only for them.

environment_variables object

Environment variables the playwright scenario can use, as name and value pairs like {"PASSWORD": "passw0rd"}. Each value is null.

status string

The monitor's current status.
Valid values:
up: Checks pass.
down: Checks fail.
validating: The service seems back up, but the recovery_period hasn't passed yet.
paused: The monitor is paused.
pending: The monitor waits for its first check.
maintenance: The monitor is in a maintenance window.

last_checked_at datetime or null

When the monitor was last checked. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

paused_at datetime or null

When the monitor was paused. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

checks_version string

Version of the checks engine. Always v2.

created_at datetime

When the monitor was created. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

updated_at datetime

When the monitor was last updated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

team_id string

Team that owns this monitor, such as t123.

team_name string

Name of the team that owns this monitor.

metadata object

Custom metadata. Each key holds a list of values. A value is a string, written as {type: "String", value}, or a catalog reference, written as {type, item_id, name, email}. User references are returned as u123 and team references as t123. Get a user's ID via List team members, and a team's ID via List teams. Values under one key must all be the same type and can't repeat.

metadata.<key>[].type string

String, or the type of the referenced item, which is one of User, Team, EscalationPolicy, OnCallSchedule, Monitor, SlackIntegration, LinearIntegration, JiraIntegration, MicrosoftTeamsIntegration, ZapierZap, OutgoingWebhook, PagerDutyIntegration or Source.

metadata.<key>[].value string

The text of a String value.

metadata.<key>[].item_id string

ID of the referenced item. For a user it's u123 or their e-mail. For a team it's t123, and for any other item it's the item's own ID. Responses return users and teams in this form. Get a user's ID via List team members, and a team's ID via List teams.

metadata.<key>[].name string or null

Referenced item's name, or null when the item has no name or no longer exists. An item can also be found by its name instead of item_id.

metadata.<key>[].email string

Referenced user's e-mail, returned for a User. A user can also be found by e-mail.

Example cURL

Create a monitor With metadata Two custom headers
curl --request POST \
  --url https://incidents.betterstack.com/api/v3/monitors \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "monitor_type": "status",
  "url": "https://facebook.com",
  "pronounceable_name": "Facebook homepage",
  "email": true,
  "sms": true,
  "call": true,
  "check_frequency": 30,
  "request_headers": [
    {
      "name": "X-Custom-Header",
      "value": "custom header value"
    }
  ]
}'
curl --request POST \
  --url https://incidents.betterstack.com/api/v3/monitors \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "monitor_type": "status",
  "url": "https://facebook.com",
  "pronounceable_name": "Facebook homepage",
  "metadata": {
    "Environment": [
      {
        "value": "production"
      }
    ],
    "Owner": [
      {
        "type": "Team",
        "name": "Platform"
      }
    ]
  }
}'
curl --request POST \
  --url https://incidents.betterstack.com/api/v3/monitors \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "monitor_type": "status",
  "url": "https://facebook.com",
  "pronounceable_name": "Facebook homepage",
  "email": true,
  "sms": true,
  "call": true,
  "check_frequency": 30,
  "request_headers": [
    {
      "name": "Content-Type",
      "value": "application/json"
    },
    {
      "name": "X-Api-Key",
      "value": "secret"
    }
  ]
}'