Create an incident
curl --request POST \
--url https://api.phare.io/uptime/incidents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Service is not working as expected",
"exclude_from_downtime": false,
"monitors": [
1,
2,
3
],
"description": "The server answered with an unexpected status code: 503.",
"incident_at": "2023-11-07T05:31:56Z",
"recovery_at": "2023-11-07T05:31:56Z",
"tags": [
"environment:production"
]
}
'import requests
url = "https://api.phare.io/uptime/incidents"
payload = {
"title": "Service is not working as expected",
"exclude_from_downtime": False,
"monitors": [1, 2, 3],
"description": "The server answered with an unexpected status code: 503.",
"incident_at": "2023-11-07T05:31:56Z",
"recovery_at": "2023-11-07T05:31:56Z",
"tags": ["environment:production"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Service is not working as expected',
exclude_from_downtime: false,
monitors: [1, 2, 3],
description: 'The server answered with an unexpected status code: 503.',
incident_at: '2023-11-07T05:31:56Z',
recovery_at: '2023-11-07T05:31:56Z',
tags: ['environment:production']
})
};
fetch('https://api.phare.io/uptime/incidents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phare.io/uptime/incidents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Service is not working as expected',
'exclude_from_downtime' => false,
'monitors' => [
1,
2,
3
],
'description' => 'The server answered with an unexpected status code: 503.',
'incident_at' => '2023-11-07T05:31:56Z',
'recovery_at' => '2023-11-07T05:31:56Z',
'tags' => [
'environment:production'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phare.io/uptime/incidents"
payload := strings.NewReader("{\n \"title\": \"Service is not working as expected\",\n \"exclude_from_downtime\": false,\n \"monitors\": [\n 1,\n 2,\n 3\n ],\n \"description\": \"The server answered with an unexpected status code: 503.\",\n \"incident_at\": \"2023-11-07T05:31:56Z\",\n \"recovery_at\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n \"environment:production\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.phare.io/uptime/incidents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Service is not working as expected\",\n \"exclude_from_downtime\": false,\n \"monitors\": [\n 1,\n 2,\n 3\n ],\n \"description\": \"The server answered with an unexpected status code: 503.\",\n \"incident_at\": \"2023-11-07T05:31:56Z\",\n \"recovery_at\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n \"environment:production\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phare.io/uptime/incidents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Service is not working as expected\",\n \"exclude_from_downtime\": false,\n \"monitors\": [\n 1,\n 2,\n 3\n ],\n \"description\": \"The server answered with an unexpected status code: 503.\",\n \"incident_at\": \"2023-11-07T05:31:56Z\",\n \"recovery_at\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n \"environment:production\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"impact": "unknown",
"title": "Service is not working as expected",
"exclude_from_downtime": false,
"monitors": [
1,
2,
3
],
"id": 1,
"project_id": 1,
"type": "monitor",
"slug": "APP-123",
"state": "unknown",
"status": "ongoing",
"description": "The server answered with an unexpected status code: 503.",
"incident_at": "2023-11-07T05:31:56Z",
"recovery_at": "2023-11-07T05:31:56Z",
"tags": [
"environment:production"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "Unauthenticated."
}{
"message": "The monitors:write permission is required to perform this action."
}{
"message": "<string>",
"errors": {
"key": [
"The key field is required"
]
}
}Incidents
Create an incident
Create a manual incident affecting monitors of the project, for an outage the monitors did not catch. It triggers the uptime.incident.created alert rules, unless it is created already recovered with recovery_at. Status pages show its title once an incident update is published.
Requires the incidents:write permission.
POST
/
uptime
/
incidents
Create an incident
curl --request POST \
--url https://api.phare.io/uptime/incidents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Service is not working as expected",
"exclude_from_downtime": false,
"monitors": [
1,
2,
3
],
"description": "The server answered with an unexpected status code: 503.",
"incident_at": "2023-11-07T05:31:56Z",
"recovery_at": "2023-11-07T05:31:56Z",
"tags": [
"environment:production"
]
}
'import requests
url = "https://api.phare.io/uptime/incidents"
payload = {
"title": "Service is not working as expected",
"exclude_from_downtime": False,
"monitors": [1, 2, 3],
"description": "The server answered with an unexpected status code: 503.",
"incident_at": "2023-11-07T05:31:56Z",
"recovery_at": "2023-11-07T05:31:56Z",
"tags": ["environment:production"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Service is not working as expected',
exclude_from_downtime: false,
monitors: [1, 2, 3],
description: 'The server answered with an unexpected status code: 503.',
incident_at: '2023-11-07T05:31:56Z',
recovery_at: '2023-11-07T05:31:56Z',
tags: ['environment:production']
})
};
fetch('https://api.phare.io/uptime/incidents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phare.io/uptime/incidents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Service is not working as expected',
'exclude_from_downtime' => false,
'monitors' => [
1,
2,
3
],
'description' => 'The server answered with an unexpected status code: 503.',
'incident_at' => '2023-11-07T05:31:56Z',
'recovery_at' => '2023-11-07T05:31:56Z',
'tags' => [
'environment:production'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phare.io/uptime/incidents"
payload := strings.NewReader("{\n \"title\": \"Service is not working as expected\",\n \"exclude_from_downtime\": false,\n \"monitors\": [\n 1,\n 2,\n 3\n ],\n \"description\": \"The server answered with an unexpected status code: 503.\",\n \"incident_at\": \"2023-11-07T05:31:56Z\",\n \"recovery_at\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n \"environment:production\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.phare.io/uptime/incidents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Service is not working as expected\",\n \"exclude_from_downtime\": false,\n \"monitors\": [\n 1,\n 2,\n 3\n ],\n \"description\": \"The server answered with an unexpected status code: 503.\",\n \"incident_at\": \"2023-11-07T05:31:56Z\",\n \"recovery_at\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n \"environment:production\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phare.io/uptime/incidents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Service is not working as expected\",\n \"exclude_from_downtime\": false,\n \"monitors\": [\n 1,\n 2,\n 3\n ],\n \"description\": \"The server answered with an unexpected status code: 503.\",\n \"incident_at\": \"2023-11-07T05:31:56Z\",\n \"recovery_at\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n \"environment:production\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"impact": "unknown",
"title": "Service is not working as expected",
"exclude_from_downtime": false,
"monitors": [
1,
2,
3
],
"id": 1,
"project_id": 1,
"type": "monitor",
"slug": "APP-123",
"state": "unknown",
"status": "ongoing",
"description": "The server answered with an unexpected status code: 503.",
"incident_at": "2023-11-07T05:31:56Z",
"recovery_at": "2023-11-07T05:31:56Z",
"tags": [
"environment:production"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "Unauthenticated."
}{
"message": "The monitors:write permission is required to perform this action."
}{
"message": "<string>",
"errors": {
"key": [
"The key field is required"
]
}
}Authorizations
Headers
Body
application/json
Incident request
Response
Success, incident created
Last modified on February 8, 2026
Was this page helpful?