Add a channel
curl --request POST \
--url https://api.zode.dev/v1/alerts/channels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"members": "<string>",
"addresses": [
"<string>"
],
"url": "<string>",
"bot_token": "<string>",
"chat_id": "<string>"
}
'import requests
url = "https://api.zode.dev/v1/alerts/channels"
payload = {
"name": "<string>",
"members": "<string>",
"addresses": ["<string>"],
"url": "<string>",
"bot_token": "<string>",
"chat_id": "<string>"
}
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>',
members: '<string>',
addresses: ['<string>'],
url: '<string>',
bot_token: '<string>',
chat_id: '<string>'
})
};
fetch('https://api.zode.dev/v1/alerts/channels', 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.zode.dev/v1/alerts/channels",
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>',
'members' => '<string>',
'addresses' => [
'<string>'
],
'url' => '<string>',
'bot_token' => '<string>',
'chat_id' => '<string>'
]),
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.zode.dev/v1/alerts/channels"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"members\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"bot_token\": \"<string>\",\n \"chat_id\": \"<string>\"\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.zode.dev/v1/alerts/channels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"members\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"bot_token\": \"<string>\",\n \"chat_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zode.dev/v1/alerts/channels")
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 \"members\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"bot_token\": \"<string>\",\n \"chat_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}Alerts
Add a channel
Add a channel (owner, admin).
Fields by kind: email members ("" | managers | all) and/or
addresses (up to 20); slack url (https://hooks.slack.com/…);
discord url (https://discord.com/api/webhooks/…); telegram
bot_token and chat_id; webhook url (https, public host). URLs
and the bot token are write-only, sealed with ZODE_SECRETS_KEY. A
webhook channel gets a signing secret, returned once as
signing_secret. Errors: 400 invalid_request, too_many (20 per
workspace); 503 secrets_unavailable (no ZODE_SECRETS_KEY),
email_unavailable. Audited as alert_channel.create.
POST
/
v1
/
alerts
/
channels
Add a channel
curl --request POST \
--url https://api.zode.dev/v1/alerts/channels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"members": "<string>",
"addresses": [
"<string>"
],
"url": "<string>",
"bot_token": "<string>",
"chat_id": "<string>"
}
'import requests
url = "https://api.zode.dev/v1/alerts/channels"
payload = {
"name": "<string>",
"members": "<string>",
"addresses": ["<string>"],
"url": "<string>",
"bot_token": "<string>",
"chat_id": "<string>"
}
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>',
members: '<string>',
addresses: ['<string>'],
url: '<string>',
bot_token: '<string>',
chat_id: '<string>'
})
};
fetch('https://api.zode.dev/v1/alerts/channels', 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.zode.dev/v1/alerts/channels",
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>',
'members' => '<string>',
'addresses' => [
'<string>'
],
'url' => '<string>',
'bot_token' => '<string>',
'chat_id' => '<string>'
]),
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.zode.dev/v1/alerts/channels"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"members\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"bot_token\": \"<string>\",\n \"chat_id\": \"<string>\"\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.zode.dev/v1/alerts/channels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"members\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"bot_token\": \"<string>\",\n \"chat_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zode.dev/v1/alerts/channels")
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 \"members\": \"<string>\",\n \"addresses\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"bot_token\": \"<string>\",\n \"chat_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}Authorizations
An API key (zode_tok_...). Create one in the console under API keys (https://console.zode.dev/tokens), or with zode login.
Body
application/json
Response
Created, a channel as in the list
⌘I