Dashboard JSON
This page explains the structure of the dashboard document that the dashboards API accepts and returns, and how to validate it with the published JSON Schema.
The Create dashboard and Update dashboard endpoints take a dashboard document in the dashboard field of the request body. The Retrieve dashboard endpoint returns the same document. This page explains the structure of the dashboard document.
JSON Schema
Axiom publishes a JSON Schema for the dashboard document:
The schema describes every field and every chart type. Axiom generates it from the v2 OpenAPI spec, which is available at https://axiom.co/docs/openapi/v2.json.
To check a dashboard document before you send it, validate it against the schema. For example, with check-jsonschema:
Don't add a $schema field to the dashboard document. The API rejects unknown top-level fields.
Top-level fields
| Field | Required | Description |
|---|---|---|
name | Yes | Dashboard name, up to 100 characters. |
owner | Yes | User ID of the owner. Use X-AXIOM-EVERYONE to share the dashboard with everyone in the organization. |
schemaVersion | Yes | Version of the dashboard format. Use 2. |
refreshTime | Yes | Seconds between automatic refreshes: 0 (off), 15, 60, or 300. |
timeWindowStart | Yes | Start of the time range. For example, qr-now-1h for the last hour, or Unix epoch milliseconds as a string. |
timeWindowEnd | Yes | End of the time range. Use qr-now with a relative start, or Unix epoch milliseconds as a string. |
charts | Yes | Dashboard elements. For more information, see Charts. |
layout | Yes | Position and size of each chart. For more information, see Layout. |
sections | No | Collapsible sections in display order. For more information, see Sections. |
description | No | Dashboard description, up to 1,000 characters. |
against | No | Relative offset for comparison against a previous period. For example, -1d. |
againstTimestamp | No | Absolute or relative timestamp for comparison. Use either against or againstTimestamp. |
uid | No | Stable dashboard identifier. Letters, digits, _, and -, up to 128 characters. |
Charts
Each element of charts is an object with the following fields:
id: Identifier of the chart. Use any string of up to 200 characters that is unique in the dashboard.type: Chart type. One ofTimeSeries,Heatmap,LogStream,Pie,Scatter,Table,TopK,Statistic,Gauge,Note,MonitorList,SmartFilter,Spacer, orVisualize.sectionId: Optional. ID of the section that contains the chart.
Charts that run a query take it in the query field. Use query.apl for an APL query or query.mpl for an MPL query. The other fields depend on the chart type. In the JSON Schema, the definition for each chart type is in $defs, named after the type. For example, $defs.TimeSeriesChart and $defs.NoteChart.
Layout
The dashboard is a grid with 12 columns. Each chart needs one element in layout:
i: ID of the chart.x: Column where the chart starts, from0to11.y: Row where the chart starts.w: Width in columns, from1to12.h: Height in rows.
Sections
sections lists the sections of the dashboard from top to bottom. Each section has the following fields:
id: Identifier of the section. Must be a UUID.title: Section name, up to 200 characters.defaultCollapsed: Optional. Iftrue, the section is collapsed when the dashboard opens.
To place a chart in a section, set the chart's sectionId to the section's id. Charts without a sectionId appear above the first section. For more information, see Dashboard sections.
Rules outside the schema
JSON Schema can't express some rules that a valid dashboard follows:
- Chart IDs, layout
ivalues, and section IDs are unique. - Every chart has a layout element whose
iis the chart'sid, and every layout element refers to a chart. - Every
sectionIdis theidof an element insections. SmartFiltercharts have nosectionId. Filter bars apply to the entire dashboard.
Example
The following dashboard document contains a note outside all sections and a time series chart in a section:
To create the dashboard, send the document in the dashboard field:
Replace API_TOKEN with your API token and DASHBOARD_JSON with the dashboard document.