Create an uptime monitor (HTTP, TCP port or ping).
const url = 'https://api.siteqwality.com/http/job';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"service_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","check_regions":["example"],"min_healthy_regions":1,"friendly_name":"example","follow_redirects":true,"final_uri":"example","check_type":"http","method":"example","keyword_search":"example","keyword_search_inverted":true,"keyword_search_case_sensitive":true,"keyword_search_regex":true,"timeout_ms":1,"uri":"example","tcp_send":"example","tcp_expect":"example","tcp_tls":true,"ping_count":1,"ping_loss_threshold":1,"recheck_on_failure":"off","web_bot_auth":true,"request_body":"example","content_type":"json","auth_type":"basic","auth_username":"example","auth_password":"example","auth_bearer_token":"example","success_http_codes":[1],"failure_http_codes":[1],"custom_http_headers":"example","run_interval_seconds":1,"run_interval_thirty_seconds":true,"group_notification_ids":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"monitor_tls":true,"monitor_dns":true,"monitor_page_speed":true,"tags":["example"],"http_version":"auto","confirmation_threshold":1,"json_path":"example","json_path_expected":"example","tls_port":1,"alert_on_invalid_certificate":true,"recovery_period_runs":1,"flap_hold":true,"flap_hold_override":true,"trace_propagation":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siteqwality.com/http/job \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "service_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "check_regions": [ "example" ], "min_healthy_regions": 1, "friendly_name": "example", "follow_redirects": true, "final_uri": "example", "check_type": "http", "method": "example", "keyword_search": "example", "keyword_search_inverted": true, "keyword_search_case_sensitive": true, "keyword_search_regex": true, "timeout_ms": 1, "uri": "example", "tcp_send": "example", "tcp_expect": "example", "tcp_tls": true, "ping_count": 1, "ping_loss_threshold": 1, "recheck_on_failure": "off", "web_bot_auth": true, "request_body": "example", "content_type": "json", "auth_type": "basic", "auth_username": "example", "auth_password": "example", "auth_bearer_token": "example", "success_http_codes": [ 1 ], "failure_http_codes": [ 1 ], "custom_http_headers": "example", "run_interval_seconds": 1, "run_interval_thirty_seconds": true, "group_notification_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "monitor_tls": true, "monitor_dns": true, "monitor_page_speed": true, "tags": [ "example" ], "http_version": "auto", "confirmation_threshold": 1, "json_path": "example", "json_path_expected": "example", "tls_port": 1, "alert_on_invalid_certificate": true, "recovery_period_runs": 1, "flap_hold": true, "flap_hold_override": true, "trace_propagation": true }'Creates a new check that runs on the specified schedule. check_type picks HTTP (the
default), a TCP port or ping (ICMP). An HTTP monitor can also provision paired TLS,
domain-expiry and page-speed monitors for the same URL; TCP and ping monitors can pair
the domain-expiry monitor when the host is a domain name.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Assign the new monitor to a service in the same account.
Location ids. Left out or empty: GET /check-locations/default, one location, or
two on different providers on an uptime plan with room in its quota.
The HTTP method; required for http. TCP and ping monitors store TCP and PING.
Milliseconds. http up to 60000, tcp 1000 to 60000, ping 1000 to 10000.
http: the URL. tcp: tcp://host:port or host:port. ping: ping://host or
the host alone. IPv6 addresses go in brackets.
tcp only: sent once connected, with \r \n \t \0 \\ \xHH escapes. At most
1024 bytes after unescaping.
tcp only: the response must contain this (same escapes, case-sensitive), 1 to
256 bytes after unescaping. Left out, connecting is enough.
tcp only: complete a verified TLS handshake first. Defaults to false.
ping only: echo requests per check, 1 to 10. Defaults to 3.
ping only: fail when at least this percent of packets are lost, 1 to 100.
Defaults to 100, so only total loss fails.
http only. Sign check requests with Web Bot Auth so bot protection such as
Cloudflare recognizes SiteQwality Monitor, a verified bot. Defaults to off.
Notification groups to alert. Left out or null: the account’s default group. []: notify no one.
Pair a domain-expiry monitor. Defaults to true for http and false for tcp and
ping, which allow it only when the host is a domain name.
Number of consecutive failed checks (1-10) required before the monitor is considered down and notifications are sent. Defaults to 1 (alert on the first failed check).
Optional JSONPath assertion on the response body.
When set, the JSONPath result must stringify to this value.
Port the TLS check connects to, 1 to 65535. Omitted keeps the stored
port (443 for a new TLS check). Needs monitor_tls.
Alert when the certificate is one a browser would reject: expired, not yet
valid, self-signed, an untrusted chain or a hostname mismatch. Defaults to
true. Ignored without monitor_tls.
Healthy runs in a row (1-10) before a recovery is notified. Defaults to 2.
Deprecated: sets flap_hold_override when that is absent.
Hold alerts while the monitor flaps. Absent or null follows the account’s
notification setting.
Responses
Section titled “ Responses ”HTTP monitor created
Invalid request body or feature not available on plan
Missing or invalid authentication
Monitor limit reached for the account’s plan
Feature requires a paid plan
Service not found in the account
Internal server error