curl --request POST \
--url https://tako.com/api/v1/monitors \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "<string>",
"parameters": {},
"channel_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"name": "",
"fire_once": true,
"active_from": "2023-11-07T05:31:56Z",
"active_until": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://tako.com/api/v1/monitors"
payload = {
"type": "<string>",
"parameters": {},
"channel_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"name": "",
"fire_once": True,
"active_from": "2023-11-07T05:31:56Z",
"active_until": "2023-11-07T05:31:56Z"
}
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({
type: '<string>',
parameters: {},
channel_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
name: '',
fire_once: true,
active_from: '2023-11-07T05:31:56Z',
active_until: '2023-11-07T05:31:56Z'
})
};
fetch('https://tako.com/api/v1/monitors', 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/monitors",
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([
'type' => '<string>',
'parameters' => [
],
'channel_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'name' => '',
'fire_once' => true,
'active_from' => '2023-11-07T05:31:56Z',
'active_until' => '2023-11-07T05:31:56Z'
]),
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/monitors"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"parameters\": {},\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"name\": \"\",\n \"fire_once\": true,\n \"active_from\": \"2023-11-07T05:31:56Z\",\n \"active_until\": \"2023-11-07T05:31:56Z\"\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/monitors")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"parameters\": {},\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"name\": \"\",\n \"fire_once\": true,\n \"active_from\": \"2023-11-07T05:31:56Z\",\n \"active_until\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tako.com/api/v1/monitors")
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 \"type\": \"<string>\",\n \"parameters\": {},\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"name\": \"\",\n \"fire_once\": true,\n \"active_from\": \"2023-11-07T05:31:56Z\",\n \"active_until\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>",
"parameters": {},
"fire_once": true,
"status": "active",
"status_reason": "fired_once",
"active_from": "2023-11-07T05:31:56Z",
"active_until": "2023-11-07T05:31:56Z",
"last_evaluated_at": "2023-11-07T05:31:56Z",
"last_evaluation_outcome": "fired",
"channel_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"resolved": {}
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST",
"candidates": []
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}Create a monitor
Create a condition on data that posts to your notification channels when it occurs
curl --request POST \
--url https://tako.com/api/v1/monitors \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "<string>",
"parameters": {},
"channel_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"name": "",
"fire_once": true,
"active_from": "2023-11-07T05:31:56Z",
"active_until": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://tako.com/api/v1/monitors"
payload = {
"type": "<string>",
"parameters": {},
"channel_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"name": "",
"fire_once": True,
"active_from": "2023-11-07T05:31:56Z",
"active_until": "2023-11-07T05:31:56Z"
}
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({
type: '<string>',
parameters: {},
channel_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
name: '',
fire_once: true,
active_from: '2023-11-07T05:31:56Z',
active_until: '2023-11-07T05:31:56Z'
})
};
fetch('https://tako.com/api/v1/monitors', 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/monitors",
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([
'type' => '<string>',
'parameters' => [
],
'channel_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'name' => '',
'fire_once' => true,
'active_from' => '2023-11-07T05:31:56Z',
'active_until' => '2023-11-07T05:31:56Z'
]),
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/monitors"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"parameters\": {},\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"name\": \"\",\n \"fire_once\": true,\n \"active_from\": \"2023-11-07T05:31:56Z\",\n \"active_until\": \"2023-11-07T05:31:56Z\"\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/monitors")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"parameters\": {},\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"name\": \"\",\n \"fire_once\": true,\n \"active_from\": \"2023-11-07T05:31:56Z\",\n \"active_until\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tako.com/api/v1/monitors")
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 \"type\": \"<string>\",\n \"parameters\": {},\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"name\": \"\",\n \"fire_once\": true,\n \"active_from\": \"2023-11-07T05:31:56Z\",\n \"active_until\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>",
"parameters": {},
"fire_once": true,
"status": "active",
"status_reason": "fired_once",
"active_from": "2023-11-07T05:31:56Z",
"active_until": "2023-11-07T05:31:56Z",
"last_evaluated_at": "2023-11-07T05:31:56Z",
"last_evaluation_outcome": "fired",
"channel_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"resolved": {}
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST",
"candidates": []
}{
"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.
typenames a registered monitor type andparametersis validated against that type’s schema. Read List monitor types first, and buildparametersfrom the type’sparameters_schema.- Every
channel_idsentry must name a channel you own, so create the channel before the monitor. An id that names no channel of yours answers404. nameis your label. Tako never fills one in and never reads it.fire_oncedefaults totrue, which pauses the monitor after its first firing. Set itfalseto fire on every new occurrence — a type that reportsfire_once_onlyrefuses that.active_fromdefaults to the moment of creation.active_untilmust be in the future and afteractive_from.
lookback_seconds in List monitor types says how far back an occurrence may have happened and still fire, and its description says how long its source takes to report one.Check the resolved subject
The201 is the only response that carries resolved — the subject the type matched from your parameters, such as the listing a ticker named. Get a monitor and List monitors don’t return it. Read it here and confirm the monitor watches what you meant before you rely on it.
When the subject is ambiguous
A400 returns a MonitorCreateRejected with an error_type:
AMBIGUOUS_SUBJECT— your parameters could have meant more than one subject.candidateslists every one, best first. Narrow the parameters and retry.BAD_REQUEST— anything else.candidatesis empty.
Authorizations
Body
A registered monitor type name, domain.subtype, for example stocks.pct_change.
64Validated against the type's parameter schema.
1 - 20 elementsYour label for the monitor. Tako never fills one in, and never reads it.
255Pause the monitor after its first firing. Set false to fire on every new occurrence, which a type reporting fire_once_only refuses.
Ignore occurrences before this instant. Null means from creation.
Pause the monitor as expired after this instant. Null means no end. Must be after active_from and in the future.
Response
The created monitor, with the resolved subject this response alone returns
active, paused Why Tako paused the monitor. Null while the monitor is active, and null when you paused it yourself.
fired_once, unloadable, expired, completed When the evaluation rule last ran for this monitor. Null until the first evaluation.
How that evaluation ended. Null until the first evaluation, and null again after you resume a paused monitor, because the pause invalidated that verdict. An active monitor with no firings and a recent predates_monitor or before_window here is alive and waiting for an occurrence that happens after it was created. no_occurrence means the type read no occurrence, which includes finding no usable data to compare.
fired, already_fired, no_occurrence, predates_monitor, outside_lookback, unloadable, completed, unknown_type, inactive, deleted, expired, before_window, crashed The subject the type resolved from your parameters, for example the listing a ticker named. Check it before trusting the monitor; this response is the only one that carries it.
Show child attributes
Show child attributes