curl --request PATCH \
--url https://tako.com/api/v1/monitors/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"channel_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"actions": [
{}
]
}
'import requests
url = "https://tako.com/api/v1/monitors/{id}"
payload = {
"channel_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"actions": [{}]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({channel_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'], actions: [{}]})
};
fetch('https://tako.com/api/v1/monitors/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'channel_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'actions' => [
[
]
]
]),
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/{id}"
payload := strings.NewReader("{\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"actions\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://tako.com/api/v1/monitors/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"actions\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tako.com/api/v1/monitors/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"actions\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>",
"parameters": {},
"subject": {},
"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"
],
"actions": [
{}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST",
"candidates": [],
"limit": 123
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}Update a monitor
Pause or resume a monitor, or replace its notification channels
curl --request PATCH \
--url https://tako.com/api/v1/monitors/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"channel_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"actions": [
{}
]
}
'import requests
url = "https://tako.com/api/v1/monitors/{id}"
payload = {
"channel_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"actions": [{}]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({channel_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'], actions: [{}]})
};
fetch('https://tako.com/api/v1/monitors/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'channel_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'actions' => [
[
]
]
]),
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/{id}"
payload := strings.NewReader("{\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"actions\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://tako.com/api/v1/monitors/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"actions\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tako.com/api/v1/monitors/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"actions\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>",
"parameters": {},
"subject": {},
"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"
],
"actions": [
{}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST",
"candidates": [],
"limit": 123
}{
"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.
- Send
status,channel_ids, or both. No other field changes after you create a monitor. To change a monitor’s type, parameters, or window, delete it and create a new one. channel_idsreplaces the monitor’s channels with the list you send. An empty list keeps the monitor recording firings, and delivers them to no channel. Every id must be a channel you own.- If the monitor’s
active_untilhas already passed, resuming returns400, because the monitor is expired rather than paused. Create a new monitor with a new window. - Resuming sets
last_evaluation_outcomeback tonull, because the pause makes the earlier outcome meaningless. - If resuming would put you over your active monitor limit, this endpoint returns
400witherror_type: LIMIT_REACHEDand alimitgiving your cap. Pause or delete another monitor first. A monitor’s own paused slot never blocks its resume. - Pausing keeps the monitor and its firings. When you want to keep the history, pause the monitor instead of deleting it.
Authorizations
Path Parameters
Resource id
Body
Set paused to stop evaluating, or active to resume.
active, paused Replace the monitor's destinations with this set. Empty means the monitor keeps recording firings and delivers to none.
20Replace the monitor's actions with this list. An empty list removes every action. Each entry is an object with kind, that kind's parameters, and optionally channel_ids. channel_ids sets where the action's output goes: leave it out to use the monitor's channels, list channels you own to use those, or send an empty list to keep the output in Tako. Actions aren't available yet, so a non-empty list returns 400.
5Response
One monitor
The parameters in the form createMonitor accepts, as this type's parameters_schema describes them. The ids Tako resolved them to never appear here. The names come back as Tako resolved them rather than as you typed them, so a stock monitor created with ticker aapl reads back ticker AAPL and the exchange MIC that resolution picked. A type whose input accepts more than one name for a subject can return a different one than you sent: a crypto monitor names the asset by coinmarketcap_id whichever name you created it with. A monitor Tako can no longer render against its type's current schema returns a reduced form; subject still names what it watches.
The subject the type resolved from your parameters, such as the listing that a ticker matched, in the shape listMonitorTypes returns as subject_schema. Check it before you rely on the monitor. Tako resolves it once, when you create the monitor, and never re-resolves it, so it names what the monitor watches rather than what that subject is called today. Empty for a type that resolves no subject.
Show child attributes
Show child attributes
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 Tako last evaluated 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 makes the earlier outcome meaningless. On an active monitor with no firings, a recent predates_monitor or before_window means the monitor is running and waiting for an occurrence that happens after you created it. no_occurrence means the type found 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 monitor's actions as Tako stored them: the fields you set on each action, and channel_ids only on an action where you set it. A field you left out takes the kind's default when the action runs. Empty for a monitor with no actions.