Monitoring
Create a monitor
Create a recurring monitor for a public page.
POST
/
v1
/
api
/
monitors
Create a monitor
curl --request POST \
--url https://api.pagepith.com/v1/api/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/pricing"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/pricing'})
};
fetch('https://api.pagepith.com/v1/api/monitors', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pagepith.com/v1/api/monitors"
payload = { "url": "https://example.com/pricing" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"monitor": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"status": "active",
"lastCheckedAt": "2023-11-07T05:31:56Z",
"lastChangedAt": "2023-11-07T05:31:56Z",
"consecutiveFailures": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"channels": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "email",
"destination": "<string>",
"enabled": true
}
]
},
"webhookSecret": "<string>"
}{
"error": "invalid_request",
"details": {}
}{
"error": "unauthorized",
"message": "<string>"
}{
"error": "payment_required",
"message": "<string>"
}Authorizations
Your API key as a Bearer token: Authorization: Bearer <api-key>.
Was this page helpful?
⌘I
Create a monitor
curl --request POST \
--url https://api.pagepith.com/v1/api/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/pricing"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/pricing'})
};
fetch('https://api.pagepith.com/v1/api/monitors', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pagepith.com/v1/api/monitors"
payload = { "url": "https://example.com/pricing" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"monitor": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"status": "active",
"lastCheckedAt": "2023-11-07T05:31:56Z",
"lastChangedAt": "2023-11-07T05:31:56Z",
"consecutiveFailures": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"channels": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "email",
"destination": "<string>",
"enabled": true
}
]
},
"webhookSecret": "<string>"
}{
"error": "invalid_request",
"details": {}
}{
"error": "unauthorized",
"message": "<string>"
}{
"error": "payment_required",
"message": "<string>"
}