---
title: "List query histories"
method: GET
path: "/v2/queries"
tags: ["Query History"]
---

# List query histories

`GET /v2/queries`

Lists the history of previous queries. Use this API to track query performance and to debug individual queries.

Filter the results with `corpus_key` or `chat_id`. Set `limit` to the maximum number of query histories to list.

## Query parameters

- `corpus_key` string
- `started_after` string, date-time
- `started_before` string, date-time
- `chat_id` string
- `history_id` string
- `limit` integer
- `page_key` string

## Headers

- `Request-Timeout` integer
- `Request-Timeout-Millis` integer

## Response `200`

An array of previous query histories.

- ListQueryHistoriesResponse — An array of query histories.
  - `queries` QueryHistorySummary[]
    - `id` string, required — The ID of the query history.
    - `query` string — The actual query made.
    - `corpus_key` string — The corpus key that the query was made on.
    - `started_at` string, date-time — ISO date time indicating when the query was first received.
    - `latency_millis` integer — Time that the query took in milliseconds.
    - `chat_id` string — The unique ID of the chat associated with the query, if this query is part of a chat.
    - `generation` string — Generated response to the query, if requested.
    - `factual_consistency_score` number, float — The factual consistency score of the generation.
    - `agent_key` string — The agent key if this query was made through an agent.
    - `session_key` string — The session key if this query was made through an agent session.
  - `metadata` object — The metadata for the list of query histories.
    - `page_key` string — A query parameter required when requesting the next page of results.

## Other responses

- `400` — Query history list request was malformed.
- `403` — Permissions do not allow listing query histories.

---

[API](https://skmtc.net/vectara/apis/vectara-rest-api-v2.md) · [All operations](https://skmtc.net/vectara/apis/vectara-rest-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vectara/vectara-rest-api-v2/versions/e85040b266cc/schema)
