Skip to main content
POST
/
v1
/
charts
Create a new chart
curl --request POST \
  --url https://api.honeyhive.ai/v1/charts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "metric": "<string>",
  "description": "<string>",
  "func": "<string>",
  "groupBy": "<string>",
  "bucketing": "day",
  "dateRange": {
    "relative": "<string>"
  },
  "query": [
    {
      "field": "<string>",
      "value": "<string>",
      "type": "<string>",
      "operator": "<string>"
    }
  ],
  "owner_id": "<string>"
}
'
{
  "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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Display name for the chart

Maximum string length: 200
metric
string
required

Name of the metric to visualize

Minimum string length: 1
description
string

Description of what the chart shows

func
string

Aggregation function to apply (e.g. sum, avg, median, min, max)

groupBy
string | null

Field to group results by

bucketing
enum<string>
default:day

Time bucket granularity for aggregation

Available options:
minute,
hour,
day,
week,
month
dateRange
object

Time range to query

query
object[]

Filters to apply to the chart data

owner_id
string

ID of the user who owns this chart

Minimum string length: 1

Response

200 - application/json

Chart created successfully

success
boolean
required
data
object
required