---
title: "Get published data from given SQL query"
method: POST
path: "/dashboards/url/{url}/getPublishData"
tags: ["Dashboard"]
---

# Get published data from given SQL query

`POST /dashboards/url/{url}/getPublishData`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/dashboards/url/{url}/getPublishData`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Given the SQL query, get published data. Returns data directly if cached (HTTP 200), or job_id if processing (HTTP 202).

## Path parameters

- `url` string, required

## Request body

- WidgetDataSpec: Parameters required for widget data retrieval with filters
  - `params` WidgetDataParams, required
    - `widget_id` string, uuid, required: UUID of the widget requesting data
    - `global_filters` object: Global filters from sidebar. Key=column, Value=filter value
    - `drilldown_filters` object: Drilldown filters from chart clicks. Always exact match.

## Response `200`

Data retrieved from cache

- SqlQueryDataResponse
  - `data` object[], required: List of rows returned by the SQL query

## Other responses

- `201`: Document created, URL follows
- `202`: Job submitted for query execution
- `400`: Bad request syntax or unsupported method
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/fe078afe239b?raw)
