Create
curl --request POST \
--url https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scope": {
"environment": "<string>",
"databaseId": "<string>",
"queueId": "<string>",
"cronId": "<string>"
},
"condition": {
"threshold": 123,
"durationSeconds": 123
},
"channelIds": [
"<string>"
],
"enabled": true,
"cooldownSeconds": 123
}
'import requests
url = "https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies"
payload = {
"name": "<string>",
"scope": {
"environment": "<string>",
"databaseId": "<string>",
"queueId": "<string>",
"cronId": "<string>"
},
"condition": {
"threshold": 123,
"durationSeconds": 123
},
"channelIds": ["<string>"],
"enabled": True,
"cooldownSeconds": 123
}
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({
name: '<string>',
scope: {
environment: '<string>',
databaseId: '<string>',
queueId: '<string>',
cronId: '<string>'
},
condition: {threshold: 123, durationSeconds: 123},
channelIds: ['<string>'],
enabled: true,
cooldownSeconds: 123
})
};
fetch('https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies', 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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies",
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([
'name' => '<string>',
'scope' => [
'environment' => '<string>',
'databaseId' => '<string>',
'queueId' => '<string>',
'cronId' => '<string>'
],
'condition' => [
'threshold' => 123,
'durationSeconds' => 123
],
'channelIds' => [
'<string>'
],
'enabled' => true,
'cooldownSeconds' => 123
]),
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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scope\": {\n \"environment\": \"<string>\",\n \"databaseId\": \"<string>\",\n \"queueId\": \"<string>\",\n \"cronId\": \"<string>\"\n },\n \"condition\": {\n \"threshold\": 123,\n \"durationSeconds\": 123\n },\n \"channelIds\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"cooldownSeconds\": 123\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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scope\": {\n \"environment\": \"<string>\",\n \"databaseId\": \"<string>\",\n \"queueId\": \"<string>\",\n \"cronId\": \"<string>\"\n },\n \"condition\": {\n \"threshold\": 123,\n \"durationSeconds\": 123\n },\n \"channelIds\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"cooldownSeconds\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies")
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 \"name\": \"<string>\",\n \"scope\": {\n \"environment\": \"<string>\",\n \"databaseId\": \"<string>\",\n \"queueId\": \"<string>\",\n \"cronId\": \"<string>\"\n },\n \"condition\": {\n \"threshold\": 123,\n \"durationSeconds\": 123\n },\n \"channelIds\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"cooldownSeconds\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"enabled": true,
"scope": {
"environment": "<string>",
"databaseId": "<string>",
"queueId": "<string>",
"cronId": "<string>"
},
"condition": {
"threshold": 123,
"durationSeconds": 123
},
"channelIds": [
"<string>"
],
"cooldownSeconds": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}alertPolicies
Create
Create a threshold or platform-health alert policy with one or more organization alert channels.
POST
/
v1
/
orgs
/
{orgId}
/
projects
/
{projectId}
/
alert-policies
Create
curl --request POST \
--url https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scope": {
"environment": "<string>",
"databaseId": "<string>",
"queueId": "<string>",
"cronId": "<string>"
},
"condition": {
"threshold": 123,
"durationSeconds": 123
},
"channelIds": [
"<string>"
],
"enabled": true,
"cooldownSeconds": 123
}
'import requests
url = "https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies"
payload = {
"name": "<string>",
"scope": {
"environment": "<string>",
"databaseId": "<string>",
"queueId": "<string>",
"cronId": "<string>"
},
"condition": {
"threshold": 123,
"durationSeconds": 123
},
"channelIds": ["<string>"],
"enabled": True,
"cooldownSeconds": 123
}
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({
name: '<string>',
scope: {
environment: '<string>',
databaseId: '<string>',
queueId: '<string>',
cronId: '<string>'
},
condition: {threshold: 123, durationSeconds: 123},
channelIds: ['<string>'],
enabled: true,
cooldownSeconds: 123
})
};
fetch('https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies', 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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies",
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([
'name' => '<string>',
'scope' => [
'environment' => '<string>',
'databaseId' => '<string>',
'queueId' => '<string>',
'cronId' => '<string>'
],
'condition' => [
'threshold' => 123,
'durationSeconds' => 123
],
'channelIds' => [
'<string>'
],
'enabled' => true,
'cooldownSeconds' => 123
]),
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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scope\": {\n \"environment\": \"<string>\",\n \"databaseId\": \"<string>\",\n \"queueId\": \"<string>\",\n \"cronId\": \"<string>\"\n },\n \"condition\": {\n \"threshold\": 123,\n \"durationSeconds\": 123\n },\n \"channelIds\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"cooldownSeconds\": 123\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.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scope\": {\n \"environment\": \"<string>\",\n \"databaseId\": \"<string>\",\n \"queueId\": \"<string>\",\n \"cronId\": \"<string>\"\n },\n \"condition\": {\n \"threshold\": 123,\n \"durationSeconds\": 123\n },\n \"channelIds\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"cooldownSeconds\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.korve.dev/v1/orgs/{orgId}/projects/{projectId}/alert-policies")
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 \"name\": \"<string>\",\n \"scope\": {\n \"environment\": \"<string>\",\n \"databaseId\": \"<string>\",\n \"queueId\": \"<string>\",\n \"cronId\": \"<string>\"\n },\n \"condition\": {\n \"threshold\": 123,\n \"durationSeconds\": 123\n },\n \"channelIds\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"cooldownSeconds\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"enabled": true,
"scope": {
"environment": "<string>",
"databaseId": "<string>",
"queueId": "<string>",
"cronId": "<string>"
},
"condition": {
"threshold": 123,
"durationSeconds": 123
},
"channelIds": [
"<string>"
],
"cooldownSeconds": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Authorizations
apiKeysession
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The organization's id (UUID) or slug — either form is accepted.
The project's id (UUID) or slug — either form is accepted.
Body
application/json
Response
Alert policy created.
Pattern:
^[a-z][a-z0-9-]{1,61}$Available options:
info, warning, critical Show child attributes
Show child attributes
Show child attributes
Show child attributes
Organization alert channel ids. Dashboard visibility is always included.
⌘I