---
title: "Get a query result by ID"
method: GET
path: "/query/{id}"
tags: ["Query"]
---

# Get a query result by ID

`GET /query/{id}`

## Request

- Base URL: `https://api.cloudglue.dev/v1`
- URL: `https://api.cloudglue.dev/v1/query/{id}`
- Auth: HTTP bearer

Retrieve a stored query run by its ID, including its result rows. Results larger than the inline storage cap are replayed truncated (truncated: true).

## Path parameters

- `id` string, uuid, required

## Response `200`

Query result details

- QueryResult
  - `id` string, uuid: Query result ID
  - `object` 'query_result': Object type identifier
  - `status` 'completed' | 'failed' | 'in_progress' | 'cancelled': Current status of the query. Synchronous queries return 'completed' or 'failed'.
  - `created_at` number: Unix timestamp of when the query was created
  - `collections` string[]: Collection IDs the query ran over
  - `sql` string, nullable: The effective SQL that was executed (echoes the request's sql)
  - `columns` object[], nullable: Result columns in select order
    - `name` string: Column name
    - `type` string: SQL type of the column
  - `rows` object[], nullable: Result rows as objects keyed by column name
  - `row_count` integer: Number of rows returned
  - `truncated` boolean: Whether the result was truncated by max_rows or the stored-result size cap
  - `dry_run` boolean: True when the query was only validated/compiled (dry_run request): columns holds the output schema and rows is null.
  - `usage` QueryUsage
    - `files_scanned` integer: Number of files loaded into the files virtual table
    - `entity_rows` integer: Number of rows loaded into the entities virtual table
    - `segment_entity_rows` integer: Number of rows loaded into the segment_entities virtual table
    - `engine_ms` number: SQL execution time in milliseconds
    - `total_ms` number: Total processing time in milliseconds, including dataset preparation
  - `error` object, nullable: Error details if the query failed
    - `code` string
    - `message` string
  - `format` 'json' | 'csv' | 'jsonl', nullable: The result format ('csv'/'jsonl' for background exports)
  - `download_url` string, nullable: Signed URL to download a completed background export. Valid for 24 hours and not refreshed on read (re-run the export if it expires); null for synchronous runs and until a background export completes
  - `download_expires_at` number, nullable: Unix timestamp (ms) when download_url expires
  - `output_bytes` integer, nullable: Compressed size of a completed background export, in bytes

## Other responses

- `404`: Query result not found
- `500`: An unexpected error occurred on the server

## Changes

- **2026-10-30** `23d3f240819f`: 2 info
  - added the optional property `code` to the response with the `404` status
  - added the optional property `code` to the response with the `500` status
- **2026-08-02** `a7a390d80571`: 1 info
  - endpoint added

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

---

[API](https://skmtc.dev/cloudglue/apis/cloudglue-api.md) - [All operations](https://skmtc.dev/cloudglue/apis/cloudglue-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cloudglue/apis/cloudglue-api/revisions/23d3f240819f?raw)
