Create monitor
POST
/monitors
Authentication
Bearer Token (hu_api_key)
Request Body required
application/jsonname
string
REQUIRED
Min length
1Max length 100type
string
REQUIRED
Values
http ping tcp dns keyword heartbeaturl
string (uri)
method
string
REQUIRED
Default
GETValues GET POST PUT DELETE PATCH HEAD OPTIONSheaders
object
body
string
interval_seconds
integer
REQUIRED
Default
60Min 30Max 3600timeout_ms
integer
REQUIRED
Default
30000Min 1000Max 60000regions
string[]
REQUIRED
Default
["us-east"]Values us-east us-west eu-west eu-central ap-southeast ap-northeastassertions
object[]
Array of:
type
string
REQUIRED
operator
string
REQUIRED
value
string
REQUIRED
auth_type
string
Values
basic bearer headerauth_config
object
keyword
string
keyword_type
string
REQUIRED
Default
containsValues contains not_contains regexheartbeat_interval
integer
Min
-9007199254740991Max 9007199254740991heartbeat_grace
integer
Min
-9007199254740991Max 9007199254740991ssl_check
boolean
REQUIRED
Default
falsedomain_check
boolean
REQUIRED
Default
falsescreenshot_on_failure
boolean
REQUIRED
Default
truescreenshot_compare
boolean
REQUIRED
Default
falsescreenshot_threshold
number
REQUIRED
Default
0.05Min 0Max 1retry_count
integer
REQUIRED
Default
2Min 0Max 5tags
string[]
Item max length
50Responses
201
Monitor created
application/jsondata
object
name
string
REQUIRED
type
string
REQUIRED
Values
http ping tcp dns keyword heartbeaturl
string (uri)
method
string
REQUIRED
Values
GET POST PUT DELETE PATCH HEAD OPTIONSheaders
object
body
string
interval_seconds
integer
REQUIRED
timeout_ms
integer
REQUIRED
regions
string[]
REQUIRED
Values
us-east us-west eu-west eu-central ap-southeast ap-northeastassertions
object[]
Array of:
type
string
REQUIRED
operator
string
REQUIRED
value
string
REQUIRED
auth_type
string
Values
basic bearer headerauth_config
object
keyword
string
keyword_type
string
REQUIRED
Values
contains not_contains regexheartbeat_interval
integer
heartbeat_grace
integer
ssl_check
boolean
REQUIRED
domain_check
boolean
REQUIRED
screenshot_on_failure
boolean
REQUIRED
screenshot_compare
boolean
REQUIRED
screenshot_threshold
number
REQUIRED
retry_count
integer
REQUIRED
tags
string[]
400
Validation error
curl -X POST 'https://happyuptime.com/api/v1/monitors' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "type": "http", "url": "https://example.com", "method": "GET", "headers": {}, "body": "string", "interval_seconds": 60, "timeout_ms": 30000, "regions": [ "us-east" ], "assertions": [ { "type": "string", "operator": "string", "value": "string" } ], "auth_type": "basic", "auth_config": {}, "keyword": "string", "keyword_type": "contains", "heartbeat_interval": -9007199254740991, "heartbeat_grace": -9007199254740991, "ssl_check": false, "domain_check": false, "screenshot_on_failure": true, "screenshot_compare": false, "screenshot_threshold": 0.05, "retry_count": 2, "tags": [ "string" ]}'
const response = await fetch('https://happyuptime.com/api/v1/monitors', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "string", "type": "http", "url": "https://example.com", "method": "GET", "headers": {}, "body": "string", "interval_seconds": 60, "timeout_ms": 30000, "regions": [ "us-east" ], "assertions": [ { "type": "string", "operator": "string", "value": "string" } ], "auth_type": "basic", "auth_config": {}, "keyword": "string", "keyword_type": "contains", "heartbeat_interval": -9007199254740991, "heartbeat_grace": -9007199254740991, "ssl_check": false, "domain_check": false, "screenshot_on_failure": true, "screenshot_compare": false, "screenshot_threshold": 0.05, "retry_count": 2, "tags": [ "string" ] })});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://happyuptime.com/api/v1/monitors', headers=headers, json={ "name": "string", "type": "http", "url": "https://example.com", "method": "GET", "headers": {}, "body": "string", "interval_seconds": 60, "timeout_ms": 30000, "regions": [ "us-east" ], "assertions": [ { "type": "string", "operator": "string", "value": "string" } ], "auth_type": "basic", "auth_config": {}, "keyword": "string", "keyword_type": "contains", "heartbeat_interval": -9007199254740991, "heartbeat_grace": -9007199254740991, "ssl_check": false, "domain_check": false, "screenshot_on_failure": true, "screenshot_compare": false, "screenshot_threshold": 0.05, "retry_count": 2, "tags": [ "string" ]})print(response.json())
201
Response
{ "data": { "name": "<string>", "type": "http", "url": "<uri>", "method": "GET", "headers": "<object>", "body": "<string>", "interval_seconds": 123, "timeout_ms": 123, "regions": [ "us-east" ], "assertions": [ { "type": "<string>", "operator": "<string>", "value": "<string>" } ], "auth_type": "basic", "auth_config": "<object>", "keyword": "<string>", "keyword_type": "contains", "heartbeat_interval": 123, "heartbeat_grace": 123, "ssl_check": true, "domain_check": true, "screenshot_on_failure": true, "screenshot_compare": true, "screenshot_threshold": 123, "retry_count": 123, "tags": [ "<string>" ] }}
API Playground
Try this endpoint
POST
/monitors