curl --request PATCH \
--url https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"metric": "<string>",
"func": "<string>",
"groupBy": "<string>",
"dateRange": {
"relative": "<string>"
},
"query": [
{
"field": "<string>",
"value": "<string>",
"type": "<string>",
"operator": "<string>"
}
],
"owner_id": "<string>"
}
'import requests
url = "https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_id}"
payload = {
"name": "<string>",
"description": "<string>",
"metric": "<string>",
"func": "<string>",
"groupBy": "<string>",
"dateRange": { "relative": "<string>" },
"query": [
{
"field": "<string>",
"value": "<string>",
"type": "<string>",
"operator": "<string>"
}
],
"owner_id": "<string>"
}
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({
name: '<string>',
description: '<string>',
metric: '<string>',
func: '<string>',
groupBy: '<string>',
dateRange: {relative: '<string>'},
query: [{field: '<string>', value: '<string>', type: '<string>', operator: '<string>'}],
owner_id: '<string>'
})
};
fetch('https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_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([
'name' => '<string>',
'description' => '<string>',
'metric' => '<string>',
'func' => '<string>',
'groupBy' => '<string>',
'dateRange' => [
'relative' => '<string>'
],
'query' => [
[
'field' => '<string>',
'value' => '<string>',
'type' => '<string>',
'operator' => '<string>'
]
],
'owner_id' => '<string>'
]),
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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metric\": \"<string>\",\n \"func\": \"<string>\",\n \"groupBy\": \"<string>\",\n \"dateRange\": {\n \"relative\": \"<string>\"\n },\n \"query\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"type\": \"<string>\",\n \"operator\": \"<string>\"\n }\n ],\n \"owner_id\": \"<string>\"\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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metric\": \"<string>\",\n \"func\": \"<string>\",\n \"groupBy\": \"<string>\",\n \"dateRange\": {\n \"relative\": \"<string>\"\n },\n \"query\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"type\": \"<string>\",\n \"operator\": \"<string>\"\n }\n ],\n \"owner_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metric\": \"<string>\",\n \"func\": \"<string>\",\n \"groupBy\": \"<string>\",\n \"dateRange\": {\n \"relative\": \"<string>\"\n },\n \"query\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"type\": \"<string>\",\n \"operator\": \"<string>\"\n }\n ],\n \"owner_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"metric": "<string>",
"func": "<string>",
"groupBy": "<string>",
"bucketing": "<string>",
"dateRange": {},
"query": [
{
"field": "<string>",
"value": "<string>",
"type": "<string>",
"operator": "<string>"
}
],
"owner_id": "<string>",
"is_active": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"owner_profile": {}
}
}Update a chart
Update a chart’s editable fields. Only fields included in the request body are modified.
curl --request PATCH \
--url https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"metric": "<string>",
"func": "<string>",
"groupBy": "<string>",
"dateRange": {
"relative": "<string>"
},
"query": [
{
"field": "<string>",
"value": "<string>",
"type": "<string>",
"operator": "<string>"
}
],
"owner_id": "<string>"
}
'import requests
url = "https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_id}"
payload = {
"name": "<string>",
"description": "<string>",
"metric": "<string>",
"func": "<string>",
"groupBy": "<string>",
"dateRange": { "relative": "<string>" },
"query": [
{
"field": "<string>",
"value": "<string>",
"type": "<string>",
"operator": "<string>"
}
],
"owner_id": "<string>"
}
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({
name: '<string>',
description: '<string>',
metric: '<string>',
func: '<string>',
groupBy: '<string>',
dateRange: {relative: '<string>'},
query: [{field: '<string>', value: '<string>', type: '<string>', operator: '<string>'}],
owner_id: '<string>'
})
};
fetch('https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_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([
'name' => '<string>',
'description' => '<string>',
'metric' => '<string>',
'func' => '<string>',
'groupBy' => '<string>',
'dateRange' => [
'relative' => '<string>'
],
'query' => [
[
'field' => '<string>',
'value' => '<string>',
'type' => '<string>',
'operator' => '<string>'
]
],
'owner_id' => '<string>'
]),
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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metric\": \"<string>\",\n \"func\": \"<string>\",\n \"groupBy\": \"<string>\",\n \"dateRange\": {\n \"relative\": \"<string>\"\n },\n \"query\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"type\": \"<string>\",\n \"operator\": \"<string>\"\n }\n ],\n \"owner_id\": \"<string>\"\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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metric\": \"<string>\",\n \"func\": \"<string>\",\n \"groupBy\": \"<string>\",\n \"dateRange\": {\n \"relative\": \"<string>\"\n },\n \"query\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"type\": \"<string>\",\n \"operator\": \"<string>\"\n }\n ],\n \"owner_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/{chart_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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metric\": \"<string>\",\n \"func\": \"<string>\",\n \"groupBy\": \"<string>\",\n \"dateRange\": {\n \"relative\": \"<string>\"\n },\n \"query\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"type\": \"<string>\",\n \"operator\": \"<string>\"\n }\n ],\n \"owner_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"metric": "<string>",
"func": "<string>",
"groupBy": "<string>",
"bucketing": "<string>",
"dateRange": {},
"query": [
{
"field": "<string>",
"value": "<string>",
"type": "<string>",
"operator": "<string>"
}
],
"owner_id": "<string>",
"is_active": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"owner_profile": {}
}
}Authorizations
A fine-grained data plane API key (values begin with hh_fgdp_). Rooted at an organization, workspace, or project, it carries the permissions chosen when it was created, and only the operations whose paths begin with /v1/projects/{project_id}/ accept it. Create one in the HoneyHive app under the project's, workspace's, or organization's Settings → API Keys, on the Data Plane tab.
Path Parameters
The unique identifier of the project that owns the chart
The unique identifier of the chart to update
Body
Display name for the chart
200Description of what the chart shows
Name of the metric to visualize
Aggregation function to apply (e.g. sum, avg, median, min, max)
Field to group results by
Time bucket granularity for aggregation
minute, five_minute, hour, day, week, month, auto Time range to query
- Option 1
- Option 2
Show child attributes
Show child attributes
Filters to apply to the chart data
Show child attributes
Show child attributes
ID of the user who owns this chart
1Was this page helpful?