---
title: "Download Card Data"
method: POST
path: "/api/card/{card_id}/query/{export_format}"
tags: ["Cards"]
---

# Download Card Data

`POST /api/card/{card_id}/query/{export_format}`

Downloads the report data. Choose `csv`, `json`, or `xlsx` depending on what you need.

If the report has no required filters, pass `parameters: []`. If it does, include a `QueryFilterParameter` entry for each required filter.

> This is a `POST` request — filters go in the request body, not the URL.

## Path parameters

- `card_id` unknown, required
- `export_format` 'csv' | 'json' | 'xlsx', required

## Request body

- QueryRequestBody — The request body for download endpoints.
  - `parameters` QueryFilterParameter[], required — Filters to apply. Pass `[]` if the report has no required filters.
    - `type` string, required — Use `"category"` for text filters. Also `"date/range"` and `"number/="`.
    - `target` unknown[], required — Points to the filter: `["variable", ["template-tag", "filter_name"]]` where `filter_name` matches the `name` field in the report's filters.
      - unknown
    - `value` string, required — The value to filter by.

## Response `200`

Query results in the format you requested.

- ExportJsonRow[]

## Other responses

- `400` — Bad Request — the JSON body is malformed or a required filter parameter is missing from the `parameters` array.
- `401` — Unauthorized — `x-api-key` header is missing or invalid.
- `403` — Forbidden — your API key doesn't have access to this Card.
- `404` — Card not found.
- `500` — Query failed — the Card's SQL threw a database error. This often means a required template tag parameter was not passed or was set to an invalid value. Check `parameters[]` on the Card and ensure all entries with `required: true` are included.

---

[API](https://skmtc.dev/livelike/apis/engagement-suite.md) · [All operations](https://skmtc.dev/livelike/apis/engagement-suite/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/livelike/engagement-suite/revisions/f3171d1c30f7/schema)
