Update an existing monitor

Update existing monitor configuration. Send only the parameters you wish to change (eg. url)

PATCH https://uptime.betterstack.com/api/v2/monitors/{monitor_id}

URL parameters

monitor_id
required string

Headers

Authorization
required string
Content_Type
string

Body parameters

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
200

Response body

{
  "data": {
    "id": "2",
    "type": "monitor",
    "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",
      "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_from": "01:02:00",
      "maintenance_to": "03:04:00",
      "maintenance_timezone": "Amsterdam",
      "maintenance_days": [
        "mon",
        "tue",
        "wed",
        "thu",
        "fri",
        "sat",
        "sun"
      ],
      "port": null,
      "expected_status_codes": [

      ]
    }
  }
}
422

Response body

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

Example cURL - Change check_frequency only

 
curl --request PATCH \
  --url https://uptime.betterstack.com/api/v2/monitors/225493 \
  --header "Authorization: Bearer $TEAM_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "check_frequency": 60
}'

Example cURL - Manage Custom Request Headers

 
curl --request PATCH \
  --url https://uptime.betterstack.com/api/v2/monitors/225493 \
  --header "Authorization: Bearer $TEAM_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "request_headers": [
      { "name": "X-Create-New-Header", "value": "New Header Value" },
      { "id": "123", "name": "X-Update-Existing-Header-Name" },
      { "id": "456", "_destroy": true }
    ]
}'