API Documentation
Platform
- GETGet API info
- Alert Rules
Uptime
Monitors
Create a monitor
Create a monitor
POST
/
uptime
/
monitors
Copy
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"
]
}'
Copy
{
"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"
}
Please be aware that the Phare API is currently in beta and is subject to change.
Authorizations
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>'.
Body
application/json
Monitor request
The body is of type object
.
Response
201
application/json
Success, monitor created
The response is of type object
.
Was this page helpful?
Copy
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"
]
}'
Copy
{
"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"
}
Assistant
Responses are generated using AI and may contain mistakes.