• /
  • EnglishEspañolFrançais日本語한국어Português
  • 로그인지금 시작하기

NerdGraph tutorial: Export dashboards and charts as files

|View as Markdown (English)

You can export your dashboards and individual charts as PDF or PNG files programmatically using the NerdGraph dashboardCreateSnapshotUrl and dashboardWidgetCreateSnapshotUrl mutations. The API supports options not available in the UI, such as template variable overrides and entity filters. You can also export dashboards using the UI.

Export a dashboard as PDF or PNG

The dashboardCreateSnapshotUrl mutation generates a snapshot URL for a full dashboard page.

팁

The guid parameter requires the page GUID, not the dashboard GUID. A dashboard can have multiple pages. To find page GUIDs, use the entitySearch query or open the dashboard page and select Manage JSON from the ... menu.

{
actor {
entitySearch(
query: "parentId ='YOUR_DASHBOARD_GUID' AND tags.isDashboardPage = 'true'"
) {
results {
entities {
guid
name
}
}
}
}
}

Mutation schema:

mutation {
dashboardCreateSnapshotUrl(
guid: EntityGuid!
params: SnapshotUrlInput
): String
}
input SnapshotUrlInput {
timeWindow: SnapshotUrlTimeWindowInput
display: SnapshotUrlDisplayInput
variables: [SnapshotUrlVariableInput!]
filter: String
format: SnapshotUrlFormat
}
input SnapshotUrlTimeWindowInput {
beginTime: EpochMilliseconds
endTime: EpochMilliseconds
duration: Milliseconds
}
input SnapshotUrlDisplayInput {
width: Int
height: Int
}
input SnapshotUrlVariableInput {
name: String!
values: [String!]!
}
enum SnapshotUrlFormat {
PDF
PNG
}

Parameter reference:

Parameter

Type

Default

Description

guid

EntityGuid!

—

Required. The entity GUID of the dashboard page.

params.timeWindow.beginTime

EpochMilliseconds

Dashboard's current time window

Start of the data window (epoch ms).

params.timeWindow.endTime

EpochMilliseconds

Dashboard's current time window

End of the data window (epoch ms).

params.timeWindow.duration

Milliseconds

—

Relative time window, alternative to beginTime/endTime.

params.display.width

Int

1920

Width in pixels for the snapshot.

params.display.height

Int

1080

Height in pixels for the snapshot.

params.variables

[SnapshotUrlVariableInput!]

Dashboard's current variable values

Pin specific values for dashboard template variables.

params.filter

String

No filter

NRQL-style entity filter applied at snapshot time.

params.format

SnapshotUrlFormat

PDF

Output format: PDF or PNG.

Examples:

중요

Snapshot URLs are publicly accessible without authentication and expire after 3 months. Share them carefully in accordance with your organization's data policies.

Export a chart as an image

The dashboardWidgetCreateSnapshotUrl mutation generates a URL to a PDF or PNG snapshot of a single chart widget. The widget doesn't need to exist on a dashboard — you can define it inline, which makes this useful for generating chart snapshots programmatically.

Mutation schema:

mutation {
dashboardWidgetCreateSnapshotUrl(
widget: DeclarativeUiWidget!
params: DashboardWidgetSnapshotUrlInput
): WidgetSnapshotResult
}
type WidgetSnapshotResult {
url: String!
}

The params argument is optional. Use it to change the output format or the size of the snapshot.

Parameter

Type

Default

Description

params.format

DashboardSnapshotUrlFormat

PNG

Output format (PDF or PNG) for the snapshot.

params.display.width

Int

640

Width in pixels for the snapshot.

params.display.height

Int

480

Height in pixels for the snapshot.

The widget parameter accepts a DeclarativeUiWidget — a JSON object with three nested layers:

declarative/widget envelope
└── widget node ← title and widget-level props
└── visualization ← visualization type and configuration
{
"type": "declarative/widget",
"version": 1,
"content": {
"type": "widget",
"props": {
"title": "My Chart Title"
},
"content": {
"type": "visualization",
"id": "viz.line",
"props": {
// visualization-specific config (nrqlQueries, colors, thresholds, etc.)
}
}
}
}

If you're building the widget definition from a dashboard you've exported as JSON, use this field mapping:

Dashboard JSON field

DeclarativeUiWidget field

title

content.props.title

visualization.id

content.content.id

rawConfiguration.*

content.content.props.* (same field names)

layout, id, linkedEntityGuids

Not included — not needed for standalone snapshots

Examples:

팁

The legacy actor.account.nrql.staticChartUrl field in NerdGraph remains available but doesn't support the latest visualization features such as thresholds, color formatting, and newer chart types. dashboardWidgetCreateSnapshotUrl is the recommended approach going forward.

중요

dashboardWidgetCreateSnapshotUrl snapshot URLs are publicly accessible without authentication and expire after 3 months.

Troubleshooting

Here's what to do if you experience any of the following errors while trying to export a dashboard:

  • From New Relic UI: We ran into an error while creating the PDF. Please try again

  • From New Relic NerdGraph: Operation on dashboard entity failed with guid:YOUR_GUID with cause: Error 504: upstream request timeout

These errors can occur if the export exceeds the API max response time. Check if any widgets on your dashboard use a large time window — for example, comparing data across an entire month. If so, try reducing the time window.

Another possible cause is a dashboard with a large number of widgets. Try removing unused widgets to see if this resolves the error.

Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.