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",
"candidates": [],
"limit": 123
}{
"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",
"candidates": [],
"limit": 123
}{
"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 returns
404for achannel_idsentry you don’t own. urlmust usehttps, on port 443 or 8443, and must resolve to a public address. See What Tako accepts as a URL.- A channel starts
active. After 2 consecutive failed deliveries, Tako pauses it. See Pause or resume a notification channel. - You can hold a limited number of channels, counted per user rather than pooled across an account. When you’re at that limit, this endpoint returns
400witherror_type: LIMIT_REACHEDand alimitgiving your cap. Delete a channel you no longer need, or contact support@tako.com about an enterprise limit. - For the request Tako posts to this channel, see Webhook deliveries.
secret when you read the 201 response. No later request returns it. Tako signs every delivery to this channel with it, so if you lose it, delete the channel and create 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 nested values.
Authorizations
Body
1 - 255The https destination that Tako posts to. Tako rejects http, a URL that embeds credentials, and a host that resolves to a private or loopback address.
2048How Tako shapes the body it posts. Use slack_workflow for a Slack Workflow Builder trigger, which rejects nested values.
webhook, slack_workflow Response
The new channel, including the signing secret that only this response 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. 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, because this response is the only place it appears and no later request returns it. Tako signs every delivery to this channel with it.