> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/export-dashboards-and-issues.md).

# Export Dashboards and Issue Graphs

Render a dashboard, widget, or issue graph as a PDF or PNG through the API.

### Endpoint

**POST** `/api/exports`

Render a dashboard, an individual dashboard widget, or an issue graph. The export service must be available in your deployment.

### Authentication

Requires permission to read the requested content and its underlying data.

Send `Authorization: Bearer <YOUR_API_KEY>` and `X-Backend-Id: <YOUR_BACKEND_ID>`. JSON requests also require `Content-Type: application/json`. The examples use `https://api.groundcover.com`; use your deployment's API URL for a self-hosted installation. Replace the example time range with one containing your data.

### Request Body

| Field       | Type   | Required | Description                                                                                                                              |
| ----------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `format`    | string | Yes      | `pdf` or `png`.                                                                                                                          |
| `target`    | object | Yes      | The content to render; see below.                                                                                                        |
| `auth`      | object | Yes      | Authentication mode. Use `{"type":"user"}` with your authenticated API request. `system` is reserved for system-authenticated workflows. |
| `timeRange` | object | No       | `start` and `end` together, as ISO timestamps or epoch milliseconds; optional IANA `timezone`.                                           |
| `capture`   | object | No       | `{"fullscreen":true}` captures the full page instead of the resolved element bounds.                                                     |

Target fields:

* Dashboard: `type: "dashboard"` and a dashboard UUID in `dashboardId`.
* Widget: `type: "widget"`, `dashboardId`, and `widgetId`.
* Issue graph: `type: "issueGraph"` and `issueId`. Optional `mode` is `default` or `workload`; `width` accepts 320–2400 pixels and `height` accepts 160–1200 pixels.

### Export a Dashboard to PDF

Replace the synthetic dashboard UUID with an existing dashboard ID.

```bash
curl --fail-with-body --request POST 'https://api.groundcover.com/api/exports' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'X-Backend-Id: <YOUR_BACKEND_ID>' \
  --header 'Content-Type: application/json' \
  --data '{
    "format": "pdf",
    "target": {
      "type": "dashboard",
      "dashboardId": "00000000-0000-4000-8000-000000000001"
    },
    "auth": {"type": "user"},
    "timeRange": {
      "start": "2026-10-28T10:00:00Z",
      "end": "2026-10-28T11:00:00Z",
      "timezone": "UTC"
    }
  }' \
  --output dashboard.pdf
```

### Response and Errors

Success returns binary PDF or PNG bytes, with `Content-Type: application/pdf` or `image/png`. Save the response to a file; do not parse it as JSON. Check the HTTP status before treating the output as a successful export.

Invalid targets or time ranges return HTTP 400. Request bodies above 10 MiB return 413. The service can return 429 when capacity is exhausted and 503 while draining. A draining response includes `error: "EXPORT_SERVICE_DRAINING"`, a message, and optionally `requestId`. Retry a transient failure with backoff; do not retry validation failures unchanged.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/export-dashboards-and-issues.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
