Create a tracker
curl --request POST \
--url https://api.unif.dev/v1/trackers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Competitor revenue swings",
"source": {
"type": "list",
"list_id": "lst_01k3m9x7v2q8r4t6y0b1n5d7fa"
},
"schedule": "daily",
"conditions": [
{
"metric": "revenue",
"change": "pct",
"over": "1d",
"gte": 0.3
},
{
"metric": "revenue",
"change": "pct",
"over": "1d",
"lte": -0.3
}
],
"webhook_id": "whk_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
'import requests
url = "https://api.unif.dev/v1/trackers"
payload = {
"name": "Competitor revenue swings",
"source": {
"type": "list",
"list_id": "lst_01k3m9x7v2q8r4t6y0b1n5d7fa"
},
"schedule": "daily",
"conditions": [
{
"metric": "revenue",
"change": "pct",
"over": "1d",
"gte": 0.3
},
{
"metric": "revenue",
"change": "pct",
"over": "1d",
"lte": -0.3
}
],
"webhook_id": "whk_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
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({
name: 'Competitor revenue swings',
source: {type: 'list', list_id: 'lst_01k3m9x7v2q8r4t6y0b1n5d7fa'},
schedule: 'daily',
conditions: [
{metric: 'revenue', change: 'pct', over: '1d', gte: 0.3},
{metric: 'revenue', change: 'pct', over: '1d', lte: -0.3}
],
webhook_id: 'whk_01k3m9x7v2q8r4t6y0b1n5d7fa'
})
};
fetch('https://api.unif.dev/v1/trackers', 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://api.unif.dev/v1/trackers",
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' => 'Competitor revenue swings',
'source' => [
'type' => 'list',
'list_id' => 'lst_01k3m9x7v2q8r4t6y0b1n5d7fa'
],
'schedule' => 'daily',
'conditions' => [
[
'metric' => 'revenue',
'change' => 'pct',
'over' => '1d',
'gte' => 0.3
],
[
'metric' => 'revenue',
'change' => 'pct',
'over' => '1d',
'lte' => -0.3
]
],
'webhook_id' => 'whk_01k3m9x7v2q8r4t6y0b1n5d7fa'
]),
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://api.unif.dev/v1/trackers"
payload := strings.NewReader("{\n \"name\": \"Competitor revenue swings\",\n \"source\": {\n \"type\": \"list\",\n \"list_id\": \"lst_01k3m9x7v2q8r4t6y0b1n5d7fa\"\n },\n \"schedule\": \"daily\",\n \"conditions\": [\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"gte\": 0.3\n },\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"lte\": -0.3\n }\n ],\n \"webhook_id\": \"whk_01k3m9x7v2q8r4t6y0b1n5d7fa\"\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://api.unif.dev/v1/trackers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Competitor revenue swings\",\n \"source\": {\n \"type\": \"list\",\n \"list_id\": \"lst_01k3m9x7v2q8r4t6y0b1n5d7fa\"\n },\n \"schedule\": \"daily\",\n \"conditions\": [\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"gte\": 0.3\n },\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"lte\": -0.3\n }\n ],\n \"webhook_id\": \"whk_01k3m9x7v2q8r4t6y0b1n5d7fa\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unif.dev/v1/trackers")
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 \"name\": \"Competitor revenue swings\",\n \"source\": {\n \"type\": \"list\",\n \"list_id\": \"lst_01k3m9x7v2q8r4t6y0b1n5d7fa\"\n },\n \"schedule\": \"daily\",\n \"conditions\": [\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"gte\": 0.3\n },\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"lte\": -0.3\n }\n ],\n \"webhook_id\": \"whk_01k3m9x7v2q8r4t6y0b1n5d7fa\"\n}"
response = http.request(request)
puts response.read_body{
"id": "trk_01k3m9x7v2q8r4t6y0b1n5d7fa",
"object": "tracker",
"name": "<string>",
"schedule": "hourly",
"enabled": true,
"conditions": [
{
"metric": "revenue",
"change": "pct",
"over": "1d",
"gte": 123,
"lte": 123
}
],
"webhook_id": "<string>",
"last_run_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "filters.revenue.gte must be a non-negative number.",
"param": "filters.revenue.gte",
"doc_url": "https://unif.dev/docs/platform/errors#parameter_invalid",
"request_id": "req_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
}Trackers
Create a tracker
Re-runs a saved search or re-checks a list on a schedule and emits a
tracker.triggered webhook when a condition is met. Trackers are how you stop polling.
POST
https://api.unif.dev/v1
/
trackers
Create a tracker
curl --request POST \
--url https://api.unif.dev/v1/trackers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Competitor revenue swings",
"source": {
"type": "list",
"list_id": "lst_01k3m9x7v2q8r4t6y0b1n5d7fa"
},
"schedule": "daily",
"conditions": [
{
"metric": "revenue",
"change": "pct",
"over": "1d",
"gte": 0.3
},
{
"metric": "revenue",
"change": "pct",
"over": "1d",
"lte": -0.3
}
],
"webhook_id": "whk_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
'import requests
url = "https://api.unif.dev/v1/trackers"
payload = {
"name": "Competitor revenue swings",
"source": {
"type": "list",
"list_id": "lst_01k3m9x7v2q8r4t6y0b1n5d7fa"
},
"schedule": "daily",
"conditions": [
{
"metric": "revenue",
"change": "pct",
"over": "1d",
"gte": 0.3
},
{
"metric": "revenue",
"change": "pct",
"over": "1d",
"lte": -0.3
}
],
"webhook_id": "whk_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
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({
name: 'Competitor revenue swings',
source: {type: 'list', list_id: 'lst_01k3m9x7v2q8r4t6y0b1n5d7fa'},
schedule: 'daily',
conditions: [
{metric: 'revenue', change: 'pct', over: '1d', gte: 0.3},
{metric: 'revenue', change: 'pct', over: '1d', lte: -0.3}
],
webhook_id: 'whk_01k3m9x7v2q8r4t6y0b1n5d7fa'
})
};
fetch('https://api.unif.dev/v1/trackers', 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://api.unif.dev/v1/trackers",
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' => 'Competitor revenue swings',
'source' => [
'type' => 'list',
'list_id' => 'lst_01k3m9x7v2q8r4t6y0b1n5d7fa'
],
'schedule' => 'daily',
'conditions' => [
[
'metric' => 'revenue',
'change' => 'pct',
'over' => '1d',
'gte' => 0.3
],
[
'metric' => 'revenue',
'change' => 'pct',
'over' => '1d',
'lte' => -0.3
]
],
'webhook_id' => 'whk_01k3m9x7v2q8r4t6y0b1n5d7fa'
]),
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://api.unif.dev/v1/trackers"
payload := strings.NewReader("{\n \"name\": \"Competitor revenue swings\",\n \"source\": {\n \"type\": \"list\",\n \"list_id\": \"lst_01k3m9x7v2q8r4t6y0b1n5d7fa\"\n },\n \"schedule\": \"daily\",\n \"conditions\": [\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"gte\": 0.3\n },\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"lte\": -0.3\n }\n ],\n \"webhook_id\": \"whk_01k3m9x7v2q8r4t6y0b1n5d7fa\"\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://api.unif.dev/v1/trackers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Competitor revenue swings\",\n \"source\": {\n \"type\": \"list\",\n \"list_id\": \"lst_01k3m9x7v2q8r4t6y0b1n5d7fa\"\n },\n \"schedule\": \"daily\",\n \"conditions\": [\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"gte\": 0.3\n },\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"lte\": -0.3\n }\n ],\n \"webhook_id\": \"whk_01k3m9x7v2q8r4t6y0b1n5d7fa\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unif.dev/v1/trackers")
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 \"name\": \"Competitor revenue swings\",\n \"source\": {\n \"type\": \"list\",\n \"list_id\": \"lst_01k3m9x7v2q8r4t6y0b1n5d7fa\"\n },\n \"schedule\": \"daily\",\n \"conditions\": [\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"gte\": 0.3\n },\n {\n \"metric\": \"revenue\",\n \"change\": \"pct\",\n \"over\": \"1d\",\n \"lte\": -0.3\n }\n ],\n \"webhook_id\": \"whk_01k3m9x7v2q8r4t6y0b1n5d7fa\"\n}"
response = http.request(request)
puts response.read_body{
"id": "trk_01k3m9x7v2q8r4t6y0b1n5d7fa",
"object": "tracker",
"name": "<string>",
"schedule": "hourly",
"enabled": true,
"conditions": [
{
"metric": "revenue",
"change": "pct",
"over": "1d",
"gte": 123,
"lte": 123
}
],
"webhook_id": "<string>",
"last_run_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "filters.revenue.gte must be a non-negative number.",
"param": "filters.revenue.gte",
"doc_url": "https://unif.dev/docs/platform/errors#parameter_invalid",
"request_id": "req_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
}Authorizations
Send your workspace API key as a bearer token:
Authorization: Bearer unif_sk_live_...
Keys are scoped to a single workspace. See Authentication.
Body
application/json
What to re-check — a saved list, or a saved search re-run each time.
Available options:
hourly, daily, weekly Any condition matching fires the tracker. Omit to fire on every run.
Response
The created tracker.
Example:
"trk_01k3m9x7v2q8r4t6y0b1n5d7fa"
Allowed value:
"tracker"Available options:
hourly, daily, weekly Was this page helpful?