POST
/
uptime
/
monitors
curl --request POST \
  --url https://api.phare.io/uptime/monitors \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "alert_policy_id": 1,
  "name": "Website",
  "protocol": "http",
  "request": {
    "method": "GET",
    "url": "https://docs.phare.io/introduction",
    "keyword": "pong"
  },
  "interval": 60,
  "timeout": 7000,
  "incident_confirmations": 1,
  "recovery_confirmations": 1,
  "regions": [
    "as-ind-bom"
  ]
}'
{
  "id": 1,
  "project_id": 1,
  "status": "fetching",
  "paused": true,
  "response_time": 123,
  "alert_policy_id": 1,
  "name": "Website",
  "protocol": "http",
  "request": {
    "method": "GET",
    "url": "https://docs.phare.io/introduction",
    "keyword": "pong"
  },
  "interval": 60,
  "timeout": 7000,
  "incident_confirmations": 1,
  "recovery_confirmations": 1,
  "regions": [
    "as-ind-bom"
  ],
  "last_checked_at": "2023-11-07T05:31:56Z",
  "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

Authorization
string
header
required

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
alert_policy_id
number
required

Associated alert policy ID

name
string
required

Monitor name

protocol
enum<string>
required
Available options:
http,
tcp
request
object
required

Monitoring request, depends of the chosen protocol

interval
enum<number>
required

Monitoring interval in seconds

Available options:
30,
60,
120,
180,
300,
600,
900,
1800,
3600
timeout
enum<number>
required

Monitoring timeout in milliseconds

Available options:
1000,
2000,
3000,
4000,
5000,
6000,
7000,
8000,
9000,
10000,
15000,
20000,
25000,
30000
incident_confirmations
enum<number>
required

Number of uninterrupted failed checks required to create an incident

Available options:
1,
2,
3,
4,
5
recovery_confirmations
enum<number>
required

Number of uninterrupted successful checks required to resolve an incident

Available options:
1,
2,
3,
4,
5
regions
enum<string>[]
required

List of regions where monitoring checks are performed

Available options:
as-ind-bom,
as-jpn-nrt,
as-sgp-sin,
eu-deu-muc,
eu-gbr-lhr,
eu-swe-arn,
na-mex-mex,
na-usa-pdx,
na-usa-ric

Response

201
application/json
Success, monitor created
alert_policy_id
number
required

Associated alert policy ID

name
string
required

Monitor name

protocol
enum<string>
required
Available options:
http,
tcp
request
object
required

Monitoring request, depends of the chosen protocol

interval
enum<number>
required

Monitoring interval in seconds

Available options:
30,
60,
120,
180,
300,
600,
900,
1800,
3600
timeout
enum<number>
required

Monitoring timeout in milliseconds

Available options:
1000,
2000,
3000,
4000,
5000,
6000,
7000,
8000,
9000,
10000,
15000,
20000,
25000,
30000
incident_confirmations
enum<number>
required

Number of uninterrupted failed checks required to create an incident

Available options:
1,
2,
3,
4,
5
recovery_confirmations
enum<number>
required

Number of uninterrupted successful checks required to resolve an incident

Available options:
1,
2,
3,
4,
5
regions
enum<string>[]
required

List of regions where monitoring checks are performed

Available options:
as-ind-bom,
as-jpn-nrt,
as-sgp-sin,
eu-deu-muc,
eu-gbr-lhr,
eu-swe-arn,
na-mex-mex,
na-usa-pdx,
na-usa-ric
id
number

Monitor ID

project_id
number

Parent project ID

status
enum<string>
Available options:
fetching,
online,
offline,
partial
paused
boolean

Whether the monitor is currently paused

response_time
number | null

Rolling average response time of the last 10 requests, in milliseconds

last_checked_at
string | null

Date of the last monitoring check

created_at
string

Date of creation for the entity

updated_at
string

Date of last update for the entity