Explore documentation

Create a new monitor

Returns a newly created monitor or validation errors.

POST https://uptime.betterstack.com/api/v2/monitors

Headers

Authorization
required string
Content-Type
string

Body parameters

team_name
string
monitor_type
string
url
string
pronounceable_name
string
email
boolean
sms
boolean
call
boolean
push
boolean
check_frequency
integer (30)
request_headers
array of objects
expected_status_codes
array of integers
domain_expiration
integer
ssl_expiration
integer
policy_id
string
follow_redirects
boolean
required_keyword
string
team_wait
integer
paused
boolean
port
string
regions
array of strings
monitor_group_id
string
recovery_period
integer
verify_ssl
boolean
confirmation_period
integer
http_method
string
request_timeout
integer
request_body
string
auth_username
string
auth_password
string
maintenance_days
array of strings
maintenance_from
string
maintenance_to
string
maintenance_timezone
string
remember_cookies
boolean
playwright_script
string
scenario_name
string
201

Response body

{
  "data": {
    "id": "238",
    "type": "endpoint",
    "attributes": {
      "url": "https://uptime.betterstack.com",
      "pronounceable_name": "Uptime homepage",
      "monitor_type": "keyword",
      "monitor_group_id": "12345",
      "last_checked_at": "2020-09-01T14:17:46.000Z",
      "status": "up",
      "policy_id": null,
      "team_name": "Test team",
      "required_keyword": "We call you",
      "verify_ssl": true,
      "check_frequency": 30,
      "call": true,
      "sms": true,
      "email": true,
      "team_wait": null,
      "http_method": "get",
      "request_timeout": 15,
      "recovery_period": 0,
      "request_body": "",
      "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_days": [
        "mon",
        "tue",
        "wed",
        "thu",
        "fri",
        "sat",
        "sun"
      ],
      "port": null,
      "expected_status_codes": [

      ]
    }
  }
}
422

Response body

{
  "errors": {
    "base": [
      "URL is invalid."
    ]
  }
}

Example cURL

Example
curl --request POST \
  --url https://uptime.betterstack.com/api/v2/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"
      }
    ]
}'