---
title: "Get a query"
method: GET
path: "/api/v1/query/history/{id}"
tags: ["query"]
---

# Get a query

`GET /api/v1/query/history/{id}`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in header `Authorization`

Returns one query from the log, including the catalog context recorded when it ran. Callers without access:view can only read their own queries.

## Path parameters

- `id` string, required

## Response `200`

OK

- QueryRecord
  - `audit_subject` string
  - `client` string
  - `completed_at` string
  - `context` QueryAssetContext[]
    - `asset_id` string
    - `description` string
    - `last_sync_at` string
    - `mrn` string
    - `name` string
    - `providers` string[]
    - `tags` string[]
    - `type` string
  - `decision` string
  - `decision_detail` object
  - `error` string
  - `id` string
  - `principal_id` string
  - `principal_type` string
  - `referenced_mrns` string[]
  - `rows_returned` integer
  - `source_id` string
  - `source_name` string
  - `started_at` string
  - `statement` string
  - `status` string
  - `truncated` boolean

## Other responses

- `404`: Not Found

## Changes

> 65 revisions in range; 1 not diffed.

- **2026-10-22** `b5eb291dd2fe`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/marmotdata/apis/marmot-api/changes/api/v1/query/history/:id/get.md)

---

[API](https://skmtc.dev/marmotdata/apis/marmot-api.md) - [All operations](https://skmtc.dev/marmotdata/apis/marmot-api/llms.txt) - [OpenAPI document](https://skmtc.dev/marmotdata/apis/marmot-api/revisions/18c57b576cb6?raw)
