Pause or resume a monitor
curl --request PATCH \
--url https://tako.com/api/v1/monitors/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{}'import requests
url = "https://tako.com/api/v1/monitors/{id}"
payload = {}
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({})
};
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([
]),
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("{}")
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("{}")
.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 = "{}"
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"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}Monitor Management
Pause or resume a monitor
Set a monitor’s status to paused or active
PATCH
/
v1
/
monitors
/
{id}
Pause or resume a monitor
curl --request PATCH \
--url https://tako.com/api/v1/monitors/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{}'import requests
url = "https://tako.com/api/v1/monitors/{id}"
payload = {}
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({})
};
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([
]),
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("{}")
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("{}")
.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 = "{}"
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"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"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.
statusis the only field this endpoint takes, and nothing else on a monitor changes after create. To change a monitor’s type, parameters, channels, or window, delete it and create a new one.- Resuming a monitor whose
active_untilhas already passed answers400. That monitor is expired, not paused — recreate it with a new window. - Resuming clears
last_evaluation_outcomeback tonull, because the pause invalidated that verdict. - Pausing keeps the monitor and its firings. Use it instead of delete when you want the history.
Authorizations
Path Parameters
Resource id
Body
application/json
Available options:
active, paused Response
One monitor
Available options:
active, paused Why Tako paused the monitor. Null while the monitor is active, and null when you paused it yourself.
Available options:
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.
Available options:
fired, already_fired, no_occurrence, predates_monitor, outside_lookback, unloadable, completed, unknown_type, inactive, deleted, expired, before_window, crashed