Run a dashboard
curl --request POST \
--url https://api.datalyr.com/v1/dashboards/{dashboardId}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"overrides": {
"date_range": {
"from": "<string>",
"to": "<string>"
},
"filters": [
{
"dimension": "<string>",
"value": "<string>"
}
],
"card_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"row_limit": 50
}
}
'import requests
url = "https://api.datalyr.com/v1/dashboards/{dashboardId}/run"
payload = { "overrides": {
"date_range": {
"from": "<string>",
"to": "<string>"
},
"filters": [
{
"dimension": "<string>",
"value": "<string>"
}
],
"card_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"row_limit": 50
} }
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({
overrides: {
date_range: {from: '<string>', to: '<string>'},
filters: [{dimension: '<string>', value: '<string>'}],
card_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
row_limit: 50
}
})
};
fetch('https://api.datalyr.com/v1/dashboards/{dashboardId}/run', 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.datalyr.com/v1/dashboards/{dashboardId}/run",
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([
'overrides' => [
'date_range' => [
'from' => '<string>',
'to' => '<string>'
],
'filters' => [
[
'dimension' => '<string>',
'value' => '<string>'
]
],
'card_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'row_limit' => 50
]
]),
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.datalyr.com/v1/dashboards/{dashboardId}/run"
payload := strings.NewReader("{\n \"overrides\": {\n \"date_range\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filters\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"card_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"row_limit\": 50\n }\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.datalyr.com/v1/dashboards/{dashboardId}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"overrides\": {\n \"date_range\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filters\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"card_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"row_limit\": 50\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalyr.com/v1/dashboards/{dashboardId}/run")
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 \"overrides\": {\n \"date_range\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filters\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"card_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"row_limit\": 50\n }\n}"
response = http.request(request)
puts response.read_body{
"dashboard": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"range": {
"from": "<string>",
"to": "<string>",
"timezone": "<string>"
},
"filters": [
{
"dimension": "<string>",
"op": "eq",
"value": "<string>"
}
],
"partial": true,
"cards": [
{
"report_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"size": "sm",
"name": "<string>",
"kind": "metric",
"status": "ok",
"filters_applied": [
{
"dimension": "<string>",
"op": "eq",
"value": "<string>"
}
],
"filters_skipped": [
{
"filter": {
"dimension": "<string>",
"op": "eq",
"value": "<string>"
},
"reason": "unsupported_source"
}
],
"result": {
"rows": [
{}
],
"totals": {},
"meta": {
"resolved": {
"metrics": [
{
"id": "<string>",
"label": "<string>",
"unit": "count",
"definition": "<string>",
"domain": "events",
"attributed": true,
"currency": "<string>"
}
],
"dimensions": [
{}
],
"filters": [
{
"dimension": "<string>",
"op": "eq",
"value": "<string>"
}
],
"date_range": {
"from": "<string>",
"to": "<string>",
"timezone": "<string>",
"preset": "<string>"
},
"granularity": "<string>",
"attribution": {
"model": "<string>",
"window_days": 123,
"source": "requested"
}
},
"returned_rows": 123,
"truncated": true,
"total_rows": 123,
"next_cursor": "<string>",
"freshness": [
{
"source": "<string>",
"latest_at": "<string>"
}
],
"unavailable": [
{
"metric": "<string>",
"reason": "<string>",
"detail": "<string>"
}
],
"deep_link": "<string>",
"executed_in_ms": 123,
"notes": [
"<string>"
]
},
"comparison": {
"date_range": {
"from": "<string>",
"to": "<string>"
},
"totals": {},
"rows": [
{}
]
},
"data_notice": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>"
}
}
]
}{
"error": "<string>",
"code": "unknown_metric",
"hint": "<string>"
}{
"error": "<string>",
"code": "insufficient_scope",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"code": "unknown_report",
"hint": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Dashboards, analyses and share links
Run a dashboard
Run every card on a dashboard and return its numbers. A read: it needs datalyr:read, writes nothing and spends the read budget.
The range is overrides.date_range, or the dashboard’s date_range, resolved once in the workspace timezone and used by every card. The filters are overrides.filters, or the dashboard’s. Each card’s result has the shape POST /reports/{reportId}/run returns, with rows cut to row_limit.
The whole run has a 22-second budget. A card still running when it ends returns status: timeout and the response sets partial: true.
POST
/
dashboards
/
{dashboardId}
/
run
Run a dashboard
curl --request POST \
--url https://api.datalyr.com/v1/dashboards/{dashboardId}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"overrides": {
"date_range": {
"from": "<string>",
"to": "<string>"
},
"filters": [
{
"dimension": "<string>",
"value": "<string>"
}
],
"card_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"row_limit": 50
}
}
'import requests
url = "https://api.datalyr.com/v1/dashboards/{dashboardId}/run"
payload = { "overrides": {
"date_range": {
"from": "<string>",
"to": "<string>"
},
"filters": [
{
"dimension": "<string>",
"value": "<string>"
}
],
"card_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"row_limit": 50
} }
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({
overrides: {
date_range: {from: '<string>', to: '<string>'},
filters: [{dimension: '<string>', value: '<string>'}],
card_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
row_limit: 50
}
})
};
fetch('https://api.datalyr.com/v1/dashboards/{dashboardId}/run', 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.datalyr.com/v1/dashboards/{dashboardId}/run",
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([
'overrides' => [
'date_range' => [
'from' => '<string>',
'to' => '<string>'
],
'filters' => [
[
'dimension' => '<string>',
'value' => '<string>'
]
],
'card_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'row_limit' => 50
]
]),
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.datalyr.com/v1/dashboards/{dashboardId}/run"
payload := strings.NewReader("{\n \"overrides\": {\n \"date_range\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filters\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"card_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"row_limit\": 50\n }\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.datalyr.com/v1/dashboards/{dashboardId}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"overrides\": {\n \"date_range\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filters\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"card_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"row_limit\": 50\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalyr.com/v1/dashboards/{dashboardId}/run")
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 \"overrides\": {\n \"date_range\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filters\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"card_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"row_limit\": 50\n }\n}"
response = http.request(request)
puts response.read_body{
"dashboard": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"range": {
"from": "<string>",
"to": "<string>",
"timezone": "<string>"
},
"filters": [
{
"dimension": "<string>",
"op": "eq",
"value": "<string>"
}
],
"partial": true,
"cards": [
{
"report_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"size": "sm",
"name": "<string>",
"kind": "metric",
"status": "ok",
"filters_applied": [
{
"dimension": "<string>",
"op": "eq",
"value": "<string>"
}
],
"filters_skipped": [
{
"filter": {
"dimension": "<string>",
"op": "eq",
"value": "<string>"
},
"reason": "unsupported_source"
}
],
"result": {
"rows": [
{}
],
"totals": {},
"meta": {
"resolved": {
"metrics": [
{
"id": "<string>",
"label": "<string>",
"unit": "count",
"definition": "<string>",
"domain": "events",
"attributed": true,
"currency": "<string>"
}
],
"dimensions": [
{}
],
"filters": [
{
"dimension": "<string>",
"op": "eq",
"value": "<string>"
}
],
"date_range": {
"from": "<string>",
"to": "<string>",
"timezone": "<string>",
"preset": "<string>"
},
"granularity": "<string>",
"attribution": {
"model": "<string>",
"window_days": 123,
"source": "requested"
}
},
"returned_rows": 123,
"truncated": true,
"total_rows": 123,
"next_cursor": "<string>",
"freshness": [
{
"source": "<string>",
"latest_at": "<string>"
}
],
"unavailable": [
{
"metric": "<string>",
"reason": "<string>",
"detail": "<string>"
}
],
"deep_link": "<string>",
"executed_in_ms": 123,
"notes": [
"<string>"
]
},
"comparison": {
"date_range": {
"from": "<string>",
"to": "<string>"
},
"totals": {},
"rows": [
{}
]
},
"data_notice": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>"
}
}
]
}{
"error": "<string>",
"code": "unknown_metric",
"hint": "<string>"
}{
"error": "<string>",
"code": "insufficient_scope",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"code": "unknown_report",
"hint": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Show child attributes
Show child attributes
Was this page helpful?