Update a report
curl --request PUT \
--url https://api.syntage.com/reports/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Credit review",
"insights": [
{
"name": "sales-revenue",
"insight": "sales-revenue",
"visible": true,
"children": "<array>"
}
],
"organizational": false
}
'import requests
url = "https://api.syntage.com/reports/{id}"
payload = {
"name": "Credit review",
"insights": [
{
"name": "sales-revenue",
"insight": "sales-revenue",
"visible": True,
"children": "<array>"
}
],
"organizational": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Credit review',
insights: [
{
name: 'sales-revenue',
insight: 'sales-revenue',
visible: true,
children: '<array>'
}
],
organizational: false
})
};
fetch('https://api.syntage.com/reports/{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://api.syntage.com/reports/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Credit review',
'insights' => [
[
'name' => 'sales-revenue',
'insight' => 'sales-revenue',
'visible' => true,
'children' => '<array>'
]
],
'organizational' => false
]),
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://api.syntage.com/reports/{id}"
payload := strings.NewReader("{\n \"name\": \"Credit review\",\n \"insights\": [\n {\n \"name\": \"sales-revenue\",\n \"insight\": \"sales-revenue\",\n \"visible\": true,\n \"children\": \"<array>\"\n }\n ],\n \"organizational\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.syntage.com/reports/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Credit review\",\n \"insights\": [\n {\n \"name\": \"sales-revenue\",\n \"insight\": \"sales-revenue\",\n \"visible\": true,\n \"children\": \"<array>\"\n }\n ],\n \"organizational\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syntage.com/reports/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Credit review\",\n \"insights\": [\n {\n \"name\": \"sales-revenue\",\n \"insight\": \"sales-revenue\",\n \"visible\": true,\n \"children\": \"<array>\"\n }\n ],\n \"organizational\": false\n}"
response = http.request(request)
puts response.read_body{
"@context": "/contexts/InsightReport",
"@id": "/reports/91106968-1abd-4d64-85c1-4e73d96fb997",
"@type": "InsightReport",
"id": "91106968-1abd-4d64-85c1-4e73d96fb997",
"name": "Credit review",
"builtIn": false,
"organizational": false,
"insights": [
{
"name": "sales-revenue",
"type": "insight",
"insight": "sales-revenue",
"visible": true,
"children": "<array>",
"builtIn": true
}
],
"createdBy": {
"id": "91106968-1abd-4d64-85c1-4e73d96fb997",
"firstName": "John",
"lastName": "Doe",
"fullName": "John Doe"
},
"createdAt": "2020-01-01T12:15:00.000Z",
"updatedAt": "2020-01-01T12:15:00.000Z"
}{
"message": "<string>"
}{
"@context": "/contexts/Error",
"@type": "hydra:Error",
"hydra:title": "An error occurred",
"hydra:description": "Access Denied."
}{
"message": "<string>"
}{
"@context": "/contexts/Error",
"@type": "hydra:Error",
"hydra:title": "An error occurred",
"hydra:description": "exampleField: Syntage score already exists."
}Reports
Update a report
Update a custom report’s name, insight layout, or organizational visibility.
Built-in reports cannot be updated. Personal reports can only be updated by their owner; organizational reports can only be updated by an admin.
PUT
/
reports
/
{id}
Update a report
curl --request PUT \
--url https://api.syntage.com/reports/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Credit review",
"insights": [
{
"name": "sales-revenue",
"insight": "sales-revenue",
"visible": true,
"children": "<array>"
}
],
"organizational": false
}
'import requests
url = "https://api.syntage.com/reports/{id}"
payload = {
"name": "Credit review",
"insights": [
{
"name": "sales-revenue",
"insight": "sales-revenue",
"visible": True,
"children": "<array>"
}
],
"organizational": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Credit review',
insights: [
{
name: 'sales-revenue',
insight: 'sales-revenue',
visible: true,
children: '<array>'
}
],
organizational: false
})
};
fetch('https://api.syntage.com/reports/{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://api.syntage.com/reports/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Credit review',
'insights' => [
[
'name' => 'sales-revenue',
'insight' => 'sales-revenue',
'visible' => true,
'children' => '<array>'
]
],
'organizational' => false
]),
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://api.syntage.com/reports/{id}"
payload := strings.NewReader("{\n \"name\": \"Credit review\",\n \"insights\": [\n {\n \"name\": \"sales-revenue\",\n \"insight\": \"sales-revenue\",\n \"visible\": true,\n \"children\": \"<array>\"\n }\n ],\n \"organizational\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.syntage.com/reports/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Credit review\",\n \"insights\": [\n {\n \"name\": \"sales-revenue\",\n \"insight\": \"sales-revenue\",\n \"visible\": true,\n \"children\": \"<array>\"\n }\n ],\n \"organizational\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syntage.com/reports/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Credit review\",\n \"insights\": [\n {\n \"name\": \"sales-revenue\",\n \"insight\": \"sales-revenue\",\n \"visible\": true,\n \"children\": \"<array>\"\n }\n ],\n \"organizational\": false\n}"
response = http.request(request)
puts response.read_body{
"@context": "/contexts/InsightReport",
"@id": "/reports/91106968-1abd-4d64-85c1-4e73d96fb997",
"@type": "InsightReport",
"id": "91106968-1abd-4d64-85c1-4e73d96fb997",
"name": "Credit review",
"builtIn": false,
"organizational": false,
"insights": [
{
"name": "sales-revenue",
"type": "insight",
"insight": "sales-revenue",
"visible": true,
"children": "<array>",
"builtIn": true
}
],
"createdBy": {
"id": "91106968-1abd-4d64-85c1-4e73d96fb997",
"firstName": "John",
"lastName": "Doe",
"fullName": "John Doe"
},
"createdAt": "2020-01-01T12:15:00.000Z",
"updatedAt": "2020-01-01T12:15:00.000Z"
}{
"message": "<string>"
}{
"@context": "/contexts/Error",
"@type": "hydra:Error",
"hydra:title": "An error occurred",
"hydra:description": "Access Denied."
}{
"message": "<string>"
}{
"@context": "/contexts/Error",
"@type": "hydra:Error",
"hydra:title": "An error occurred",
"hydra:description": "exampleField: Syntage score already exists."
}Authorizations
Your API key is available in the Production and Sandbox dashboards.
Body
application/json
Response
Report resource response
Was this page helpful?