curl --request POST \
--url https://api.datalyr.com/v1/reports/reorder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order": {
"ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"dry_run": false
}
'import requests
url = "https://api.datalyr.com/v1/reports/reorder"
payload = {
"order": { "ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] },
"dry_run": False
}
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({order: {ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']}, dry_run: false})
};
fetch('https://api.datalyr.com/v1/reports/reorder', 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/reports/reorder",
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([
'order' => [
'ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'dry_run' => false
]),
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/reports/reorder"
payload := strings.NewReader("{\n \"order\": {\n \"ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"dry_run\": false\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/reports/reorder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order\": {\n \"ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"dry_run\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalyr.com/v1/reports/reorder")
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 \"order\": {\n \"ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"dry_run\": false\n}"
response = http.request(request)
puts response.read_body{
"dry_run": true,
"applied": true,
"diff": {
"action": "<string>",
"resource": {
"type": "conversion_rule",
"id": "<string>",
"label": "<string>"
},
"prior_state": {},
"new_state": {},
"changes": [
{
"field": "<string>",
"from": "<unknown>",
"to": "<unknown>"
}
],
"effects": [
{
"type": "postback_target",
"summary": "<string>",
"platform": "<string>",
"ad_account_id": "<string>",
"asset_id": "<string>",
"asset_field": "<string>",
"endpoint_url_masked": "<string>",
"trigger_event": "<string>",
"trigger_event_source": "<string>",
"platform_event": "<string>",
"active": true,
"operation": "put",
"key": "<string>",
"path": "<string>",
"requires_approval": true,
"approver_roles": [
"<string>"
],
"review_surface": "<string>",
"supersedes": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
},
"audit_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>"
}{
"error": "<string>",
"code": "insufficient_scope",
"required_scope": "<string>"
}{
"error": "<string>",
"code": "invalid_definition",
"hint": "<string>"
}{
"error": "<string>"
}Reorder saved reports
Set the order of the cards on the Reports page. Needs datalyr:write:reports.
Send every live report id on the board, each once, in the new order. A list that adds, drops or repeats an id returns 409 with code: stale_order: read GET /reports again and resend. The order changes for every member of the workspace. No MCP tool reorders.
curl --request POST \
--url https://api.datalyr.com/v1/reports/reorder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order": {
"ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"dry_run": false
}
'import requests
url = "https://api.datalyr.com/v1/reports/reorder"
payload = {
"order": { "ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] },
"dry_run": False
}
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({order: {ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']}, dry_run: false})
};
fetch('https://api.datalyr.com/v1/reports/reorder', 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/reports/reorder",
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([
'order' => [
'ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'dry_run' => false
]),
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/reports/reorder"
payload := strings.NewReader("{\n \"order\": {\n \"ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"dry_run\": false\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/reports/reorder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order\": {\n \"ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"dry_run\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalyr.com/v1/reports/reorder")
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 \"order\": {\n \"ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"dry_run\": false\n}"
response = http.request(request)
puts response.read_body{
"dry_run": true,
"applied": true,
"diff": {
"action": "<string>",
"resource": {
"type": "conversion_rule",
"id": "<string>",
"label": "<string>"
},
"prior_state": {},
"new_state": {},
"changes": [
{
"field": "<string>",
"from": "<unknown>",
"to": "<unknown>"
}
],
"effects": [
{
"type": "postback_target",
"summary": "<string>",
"platform": "<string>",
"ad_account_id": "<string>",
"asset_id": "<string>",
"asset_field": "<string>",
"endpoint_url_masked": "<string>",
"trigger_event": "<string>",
"trigger_event_source": "<string>",
"platform_event": "<string>",
"active": true,
"operation": "put",
"key": "<string>",
"path": "<string>",
"requires_approval": true,
"approver_roles": [
"<string>"
],
"review_surface": "<string>",
"supersedes": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
},
"audit_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>"
}{
"error": "<string>",
"code": "insufficient_scope",
"required_scope": "<string>"
}{
"error": "<string>",
"code": "invalid_definition",
"hint": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
The result of the write. dry_run and applied state which of the two happened; on a dry run nothing was written.
False on a dry run and on every error.
The change, in full. A dry run returns the change it WOULD make; an applied write returns the change it DID make, in the same shape, so the two can be compared directly.
Show child attributes
Show child attributes
Present on an applied write. The handle POST /audit/{auditId}/undo takes.
Was this page helpful?