metrics

Import a Grafana dashboard JSON model or a dashboard screenshot as a new dashboard. Panels that match the project's metrics import at once. An AI agent converts the rest, and the response then has an id to poll.

post/api/projects/{project_id}/metrics/dashboard_imports/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/metrics/dashboard_imports/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request body

source'grafana' | 'screenshot' required
  • grafana - Grafana
  • screenshot - Screenshot
namestring

Name of the new dashboard. Defaults to the Grafana dashboard title, or to 'Imported dashboard'.

grafana_jsonstring

The Grafana dashboard JSON model as text, from Dashboard settings > JSON Model or from an export. Required when source is 'grafana'.

image_base64string

The screenshot as base64, without a data URL prefix. PNG, JPEG, WebP or GIF, at most 5 MB. Required when source is 'screenshot'.

Response

idstring nullable required

Id to poll for the status. Null when the import finished in the request, with no agent.

source'grafana' | 'screenshot' required
  • grafana - Grafana
  • screenshot - Screenshot
status'running' | 'completed' | 'failed' required
  • running - Running
  • completed - Completed
  • failed - Failed
dashboard_namestring required

Name of the new dashboard.

layout_roundsinteger nullable required

How many pictures of the dashboard the import compares with the screenshot, at most. Null when the import does not check the layout.

layout_roundinteger nullable required

The comparison that runs, from 1, while the phase is 'checking_layout'.

dashboard_idinteger nullable required

Id of the new dashboard, when it exists.

errorstring nullable required

Why the import failed, when it failed.

Changes

No recorded changes to this operation across all 1 revision of this API.