Change a report
curl --request PATCH \
--url https://api.statisfy.com/v1/reports/{report_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"name": null,
"owner": "<string>",
"visibility": null
}
'import requests
url = "https://api.statisfy.com/v1/reports/{report_id}"
payload = {
"description": "<string>",
"name": None,
"owner": "<string>",
"visibility": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: '<string>', name: null, owner: '<string>', visibility: null})
};
fetch('https://api.statisfy.com/v1/reports/{report_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.statisfy.com/v1/reports/{report_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'name' => null,
'owner' => '<string>',
'visibility' => null
]),
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.statisfy.com/v1/reports/{report_id}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"name\": null,\n \"owner\": \"<string>\",\n \"visibility\": null\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.statisfy.com/v1/reports/{report_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"name\": null,\n \"owner\": \"<string>\",\n \"visibility\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/reports/{report_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"name\": null,\n \"owner\": \"<string>\",\n \"visibility\": null\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"id": "<string>",
"name": "<string>",
"owner": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"visibility": "team",
"widgets": [
{
"built_with": "sql",
"chart": {
"colors": [
"<string>"
],
"compact_notation": "K",
"currency_symbol": "<string>",
"decimal_digits": 10,
"max_series": 2,
"orientation": "vertical",
"page_size": 2,
"pivot_column": "<string>",
"series_column": "<string>",
"show_data_labels": true,
"show_legend": true,
"stacked": true,
"value_column": "<string>",
"value_format": "number",
"x_axis": "<string>",
"y_axis": [
"<string>"
]
},
"id": "<string>",
"position": {
"h": 2,
"w": 2,
"x": 1,
"y": 1
},
"title": "<string>",
"type": "<string>",
"markdown": true,
"sql": "<string>",
"text": "<string>"
}
]
}reports
Change a report
Changes a report’s name, description, visibility or owner (null leaves a team report with no owner; a private report keeps one). Its widgets change through /v1/reports//widgets. A 409 with Retry-After means another change held the report, so nothing was written: send it again.
PATCH
/
v1
/
reports
/
{report_id}
Change a report
curl --request PATCH \
--url https://api.statisfy.com/v1/reports/{report_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"name": null,
"owner": "<string>",
"visibility": null
}
'import requests
url = "https://api.statisfy.com/v1/reports/{report_id}"
payload = {
"description": "<string>",
"name": None,
"owner": "<string>",
"visibility": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: '<string>', name: null, owner: '<string>', visibility: null})
};
fetch('https://api.statisfy.com/v1/reports/{report_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.statisfy.com/v1/reports/{report_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'name' => null,
'owner' => '<string>',
'visibility' => null
]),
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.statisfy.com/v1/reports/{report_id}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"name\": null,\n \"owner\": \"<string>\",\n \"visibility\": null\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.statisfy.com/v1/reports/{report_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"name\": null,\n \"owner\": \"<string>\",\n \"visibility\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/reports/{report_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"name\": null,\n \"owner\": \"<string>\",\n \"visibility\": null\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"id": "<string>",
"name": "<string>",
"owner": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"visibility": "team",
"widgets": [
{
"built_with": "sql",
"chart": {
"colors": [
"<string>"
],
"compact_notation": "K",
"currency_symbol": "<string>",
"decimal_digits": 10,
"max_series": 2,
"orientation": "vertical",
"page_size": 2,
"pivot_column": "<string>",
"series_column": "<string>",
"show_data_labels": true,
"show_legend": true,
"stacked": true,
"value_column": "<string>",
"value_format": "number",
"x_axis": "<string>",
"y_axis": [
"<string>"
]
},
"id": "<string>",
"position": {
"h": 2,
"w": 2,
"x": 1,
"y": 1
},
"title": "<string>",
"type": "<string>",
"markdown": true,
"sql": "<string>",
"text": "<string>"
}
]
}Authorizations
An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.
Body
application/json
Response
200 - application/json
Successful Response
Was this page helpful?