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.
Team to use, such as t123. Get the ID via List teams. Required when you can access more than one team.
Bearer $TOKEN
application/json
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.
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.
The name of the monitor, which we use when we call you.
ID of the monitor group this monitor belongs to.
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.
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.
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.
How long checks must keep passing before the incident resolves, in seconds. Possible values: 0, 60, 180, 300, 900, 1800, 3600, 7200.
How long to wait after a failure before starting an incident, in seconds, from 0 to 86400.
The keyword to look for. Required for keyword, keyword_absence and udp monitors.
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.
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.
Custom request headers, as a list of {name, value} objects. A list replaces all headers, and an empty list removes them all.
The header name, like Content-Type.
The header value, like application/json.
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.
Whether we follow HTTP redirects.
Whether we keep cookies when redirecting.
Whether a check fails on an invalid SSL certificate.
HTTP basic-auth username. null when none is set. Sending null doesn't remove a stored value.
HTTP basic-auth password. Not returned after it's saved. Sending null doesn't remove a stored value.
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.
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.
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.
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.
The port of the proxy server, from 1 to 65535. Requires proxy_host.
Whether to send an e-mail to the on-call person. Ignored while an escalation policy is set.
Whether to send an SMS to the on-call person. Ignored while an escalation policy is set.
Whether to call the on-call person. Ignored while an escalation policy is set.
Whether to send a push notification to the on-call person. Ignored while an escalation policy is set.
Whether to send a critical push notification that ignores the mute switch and Do Not Disturb mode. Ignored while an escalation policy is set.
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.
ID of the escalation policy for alerts, or null to alert the current on-call person directly.
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.
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.
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.
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.
End of the daily maintenance window, as HH:MM:SS, like 03:00:00. Required with maintenance_from. null when no window is set.
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.
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.
The JavaScript source of the scenario, for playwright monitors.
The name of a playwright monitor's scenario. Required for playwright monitors, and returned only for them.
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.
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.
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.
The text of a String value.
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.
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.
Referenced user's e-mail, returned for a User. A user can also be found by e-mail.
{
"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"
}
}
}
}
}
{
"errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-an-incidents-api-token"
}
{
"errors": "This API token is read-only and cannot be used for write operations."
}
{
"errors": {
"base": [
"URL is invalid"
]
}
}
{
"errors": "Please upgrade your account before using these attributes",
"unauthorized_attributes": {
"check_frequency": "Your plan checks at most every 180 seconds. Upgrade your plan to check more often.",
"sms": "Your plan doesn't include SMS alerts. Upgrade your plan to use them."
}
}
Returns the newly created monitor.
The API token is missing or invalid.
The token is read-only, your role doesn't allow the action, or the token can't be used for this API. The organization has used all the monitors its plan includes.
Validation failed, such as an invalid url. errors lists the messages by attribute, with messages about the whole monitor under base.
A feature the plan doesn't include was set, or check_frequency is below the plan's shortest interval. unauthorized_attributes maps each attribute to what the plan allows. Nothing is saved.
An attribute is unknown or unsupported, or a token with access to more than one team didn't name a team.
Another change to the organization's monitor quota is in progress. Try again.
The ID of the monitor.
Always monitor.
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.
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.
The name of the monitor, which we use when we call you.
ID of the monitor group this monitor belongs to.
Whether the monitor is paused. A paused monitor opens no incidents and sends no alerts.
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.
How often the monitor actually checks, in seconds. effective_check_frequency_reason says why it differs from check_frequency.
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.
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.
How long checks must keep passing before the incident resolves, in seconds. Possible values: 0, 60, 180, 300, 900, 1800, 3600, 7200.
How long to wait after a failure before starting an incident, in seconds, from 0 to 86400.
The keyword to look for.
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.
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.
Custom request headers, as a list of {name, value} objects. A list replaces all headers, and an empty list removes them all.
The header's ID.
The header name, like Content-Type.
The header value, like application/json.
HTTP status codes from 100 to 599 that count as up. A 3xx code needs follow_redirects set to false.
Whether we follow HTTP redirects.
Whether we keep cookies when redirecting.
Whether a check fails on an invalid SSL certificate.
HTTP basic-auth username. null when none is set.
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.
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.
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.
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.
The port of the proxy server, from 1 to 65535. Requires proxy_host.
Whether to send an e-mail to the on-call person. Ignored while an escalation policy is set.
Whether to send an SMS to the on-call person. Ignored while an escalation policy is set.
Whether to call the on-call person. Ignored while an escalation policy is set.
Whether to send a push notification to the on-call person. Ignored while an escalation policy is set.
Whether to send a critical push notification that ignores the mute switch and Do Not Disturb mode. Ignored while an escalation policy is set.
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.
ID of the escalation policy for alerts, or null to alert the current on-call person directly.
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.
The escalation policy used for alerts, linked by its ID. Names the same policy as escalation_policy_id. null when the monitor has none.
ID of the linked escalation policy.
Always escalation_policy.
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.
ID of the linked escalation policy.
Always escalation_policy.
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.
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.
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.
End of the daily maintenance window, as HH:MM:SS, like 03:00:00. Required with maintenance_from. null when no window is set.
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.
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.
The JavaScript source of the scenario, for playwright monitors.
The name of a playwright monitor's scenario. Required for playwright monitors, and returned only for them.
Environment variables the playwright scenario can use, as name and value pairs like {"PASSWORD": "passw0rd"}. Each value is null.
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.
When the monitor was last checked. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
When the monitor was paused. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
Version of the checks engine. Always v2.
When the monitor was created. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
When the monitor was last updated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
Team that owns this monitor, such as t123.
Name of the team that owns this monitor.
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.
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.
The text of a String value.
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.
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.
Referenced user's e-mail, returned for a User. A user can also be found by e-mail.
Example cURL