---
title: "Get a log query"
method: GET
path: "/logs/queries/{queryId}"
tags: ["Logs"]
---

# Get a log query

`GET /logs/queries/{queryId}`

## Request

- Base URL: `https://api.sazabi.com/v1`
- URL: `https://api.sazabi.com/v1/logs/queries/{queryId}`
- Auth: none declared

Get one stored log query by its `queryId`: the question it answered (or the spec's plain-words reading), how it was read, the times it read, the kind of results it returned, and its log query spec. Any `queryId` a `logs.ask` answer or `logs.executeQuery` run returned can be read, runs included. Run it again with `logs.executeQuery`. An unknown id, or one from another project, is not found.

## Path parameters

- `queryId` string, uuid, required: `queryId` of a `logs.ask` answer or a `logs.executeQuery` run in the project.

## Query parameters

- `projectId` string, uuid: Project the query belongs to. Auto-filled from CLI and SDK context when omitted.

## Response `200`

OK

- object
  - `queryId` string, uuid, required: `queryId` of a `logs.ask` answer or a `logs.executeQuery` run in the project.
  - `question` string, required: The question as stored, with emails and key-like tokens redacted; for a spec, its plain-words reading.
  - `interpretedAs` string, nullable, required: How the question was read. Null for a spec.
  - `window` object, required: The absolute times the query read. `logs.executeQuery` with this `queryId` and no `window` reads them again.
    - `from` string, date-time, required
    - `to` string, date-time, required
  - `parentId` string, uuid, nullable, required: For a run of an earlier query, that query's `queryId`; null for a question or a spec run directly.
  - `resultsKind` string, nullable, required: The kind of results it returned (`rows`, `value`, `distinct`, `table`, `messages`, `series`, `search`). Null when it returned none.
  - `createdAt` string, date-time, required: When the query was asked or run.
  - `spec` object, required: The query's log query spec (version 2): which lines (`predicate`), grouped by what (`dimensions`), measured how (`measure`), shaped as what (`output`). It is the shape `logs.executeQuery` takes as `spec`.

## Changes

- **2026-10-13** `3dd07e679d4f`: 2 breaking
  - removed the required property `source` from the response with the `200` status
  - removed the required property `status` from the response with the `200` status
- **2026-10-10** `14b670dff679`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/sazabi/apis/sazabi-public-api/changes/logs/queries/:queryId/get.md)

---

[API](https://skmtc.dev/sazabi/apis/sazabi-public-api.md) - [All operations](https://skmtc.dev/sazabi/apis/sazabi-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sazabi/apis/sazabi-public-api/revisions/965b6230cf45?raw)
