Create chart trigger
curl --request POST \
--url https://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cron_spec": "<string>"
}
'import requests
url = "https://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers"
payload = { "cron_spec": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cron_spec: '<string>'})
};
fetch('https://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers', 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://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers",
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([
'cron_spec' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers"
payload := strings.NewReader("{\n \"cron_spec\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cron_spec\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cron_spec\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"trigger_id": "550e8400-e29b-41d4-a716-446655440000",
"chart_id": "550e8400-e29b-41d4-a716-446655440000",
"action_id": "<string>",
"name": "<string>",
"cron_spec": "<string>",
"enabled": true,
"filters": {},
"trigger_type": "always",
"trigger_condition": {},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Create chart trigger
Create a scheduled trigger for a chart.
Create chart trigger
curl --request POST \
--url https://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cron_spec": "<string>"
}
'import requests
url = "https://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers"
payload = { "cron_spec": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cron_spec: '<string>'})
};
fetch('https://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers', 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://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers",
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([
'cron_spec' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers"
payload := strings.NewReader("{\n \"cron_spec\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cron_spec\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.anlytic.com/api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cron_spec\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"trigger_id": "550e8400-e29b-41d4-a716-446655440000",
"chart_id": "550e8400-e29b-41d4-a716-446655440000",
"action_id": "<string>",
"name": "<string>",
"cron_spec": "<string>",
"enabled": true,
"filters": {},
"trigger_type": "always",
"trigger_condition": {},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
bearerAuthapiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
URL-friendly workspace identifier
Example:
"acme"
Example:
"550e8400-e29b-41d4-a716-446655440000"
Example:
"550e8400-e29b-41d4-a716-446655440000"
Body
application/json
Cron expression that controls when the trigger runs.
Available options:
always, has_results, no_results, value_threshold Maximum string length:
120Action to execute when the trigger fires.
Required for trigger types that need a condition, such as value_threshold.
Response
Created trigger
Example:
"550e8400-e29b-41d4-a716-446655440000"
Example:
"550e8400-e29b-41d4-a716-446655440000"
Cron expression that controls when the trigger runs.
Available options:
always, has_results, no_results, value_threshold Example:
"2024-01-15T10:30:00Z"
Example:
"2024-01-15T10:30:00Z"
Last modified on July 29, 2026