curl --request POST \
--url https://tako.com/api/v1/notification_channels \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"url": "<string>",
"kind": "webhook"
}
'import requests
url = "https://tako.com/api/v1/notification_channels"
payload = {
"name": "<string>",
"url": "<string>",
"kind": "webhook"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', url: '<string>', kind: 'webhook'})
};
fetch('https://tako.com/api/v1/notification_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://tako.com/api/v1/notification_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>',
'url' => '<string>',
'kind' => 'webhook'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://tako.com/api/v1/notification_channels"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"kind\": \"webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://tako.com/api/v1/notification_channels")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"kind\": \"webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tako.com/api/v1/notification_channels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"kind\": \"webhook\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "webhook",
"url": "<string>",
"status": "active",
"status_reason": "delivery_failures",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"secret": "<string>"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}Create a notification channel
Register an https destination that monitors post to when they fire
curl --request POST \
--url https://tako.com/api/v1/notification_channels \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"url": "<string>",
"kind": "webhook"
}
'import requests
url = "https://tako.com/api/v1/notification_channels"
payload = {
"name": "<string>",
"url": "<string>",
"kind": "webhook"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', url: '<string>', kind: 'webhook'})
};
fetch('https://tako.com/api/v1/notification_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://tako.com/api/v1/notification_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>',
'url' => '<string>',
'kind' => 'webhook'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://tako.com/api/v1/notification_channels"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"kind\": \"webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://tako.com/api/v1/notification_channels")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"kind\": \"webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tako.com/api/v1/notification_channels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"kind\": \"webhook\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "webhook",
"url": "<string>",
"status": "active",
"status_reason": "delivery_failures",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"secret": "<string>"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}Notes
- To authenticate, you’ll need a Tako API key. It’s best practice to store it as an environment variable to avoid hardcoding sensitive credentials in your code.
- Create the channel before the monitor that uses it — Create a monitor answers
404for achannel_idsentry that names no channel of yours. urlmust behttps. Tako rejectshttp, and rejects a URL that embeds credentials.- A channel starts
active. Tako pauses it after two consecutive failed deliveries; see Pause or resume a notification channel.
201 returns secret, and no later request ever returns it again. Store it when you read this response. Every delivery to this channel carries a signature computed with it, so losing it means deleting the channel and creating a new one.Choosing a kind
kind decides how Tako shapes the request body it posts:
webhook(the default) — nested JSON that namespaces the monitor, the firing, and the payload.slack_workflow— a flat body of strings, for a Slack Workflow Builder trigger, which rejects any nested value.
Authorizations
Body
1 - 255The https destination the channel posts to. Tako rejects http, and rejects a URL that embeds credentials.
2048How Tako shapes the body it posts. Send slack_workflow for a Slack Workflow Builder trigger, which rejects a nested value.
webhook, slack_workflow Response
The created channel, with the signing secret this response alone returns
How Tako shapes the request body it posts to a channel: webhook sends nested JSON that namespaces the monitor, the firing, and the payload, and slack_workflow sends a flat body of strings for a Slack Workflow Builder trigger, which rejects any nested value.
webhook, slack_workflow active, paused Why Tako paused the channel. Null while the channel is active, and null when you paused it yourself.
delivery_failures The signing secret for this channel. Store it now: this response is the only place it appears, and no later request returns it. Every delivery to this channel carries a signature computed with it.