curl --request POST \
--url https://api.phare.io/uptime/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Website",
"protocol": "http",
"request": {
"method": "HEAD",
"url": "https://docs.phare.io/introduction",
"tls_skip_verify": false,
"follow_redirects": true,
"keyword": "pong",
"user_agent_secret": "definitely-not-a-bot",
"headers": [
{
"name": "X-Phare-Says",
"value": "Hello world!"
}
]
},
"interval": 60,
"timeout": 7000,
"success_assertions": [
{
"type": "status_code",
"operator": "in",
"value": "2xx,30x,418"
}
],
"incident_confirmations": 1,
"recovery_confirmations": 1,
"regions": [
"as-jpn-hnd"
]
}'
{
"id": 1,
"project_id": 1,
"status": "fetching",
"paused": true,
"response_time": 123,
"one_day_availability": 99.9999,
"seven_days_availability": 99.9999,
"name": "Website",
"protocol": "http",
"request": {
"method": "HEAD",
"url": "https://docs.phare.io/introduction",
"tls_skip_verify": false,
"follow_redirects": true,
"keyword": "pong",
"user_agent_secret": "definitely-not-a-bot",
"headers": [
{
"name": "X-Phare-Says",
"value": "Hello world!"
}
]
},
"interval": 60,
"timeout": 7000,
"success_assertions": [
{
"type": "status_code",
"operator": "in",
"value": "2xx,30x,418"
}
],
"incident_confirmations": 1,
"recovery_confirmations": 1,
"regions": [
"as-jpn-hnd"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
Create a monitor
curl --request POST \
--url https://api.phare.io/uptime/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Website",
"protocol": "http",
"request": {
"method": "HEAD",
"url": "https://docs.phare.io/introduction",
"tls_skip_verify": false,
"follow_redirects": true,
"keyword": "pong",
"user_agent_secret": "definitely-not-a-bot",
"headers": [
{
"name": "X-Phare-Says",
"value": "Hello world!"
}
]
},
"interval": 60,
"timeout": 7000,
"success_assertions": [
{
"type": "status_code",
"operator": "in",
"value": "2xx,30x,418"
}
],
"incident_confirmations": 1,
"recovery_confirmations": 1,
"regions": [
"as-jpn-hnd"
]
}'
{
"id": 1,
"project_id": 1,
"status": "fetching",
"paused": true,
"response_time": 123,
"one_day_availability": 99.9999,
"seven_days_availability": 99.9999,
"name": "Website",
"protocol": "http",
"request": {
"method": "HEAD",
"url": "https://docs.phare.io/introduction",
"tls_skip_verify": false,
"follow_redirects": true,
"keyword": "pong",
"user_agent_secret": "definitely-not-a-bot",
"headers": [
{
"name": "X-Phare-Says",
"value": "Hello world!"
}
]
},
"interval": 60,
"timeout": 7000,
"success_assertions": [
{
"type": "status_code",
"operator": "in",
"value": "2xx,30x,418"
}
],
"incident_confirmations": 1,
"recovery_confirmations": 1,
"regions": [
"as-jpn-hnd"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
Use a user token to access authenticated routes. The token must be specified in the Authorization HTTP header with the following format 'Authorization: Bearer <token>'.
Monitor request
The body is of type object
.
Success, monitor created
The response is of type object
.
Was this page helpful?