---
title: "List Harbor Saved Queries"
method: GET
path: "/api/harbors/{harbor_id}/saved-queries"
tags: ["Harbors"]
---

# List Harbor Saved Queries

`GET /api/harbors/{harbor_id}/saved-queries`

## Request

- Base URL: `https://app.polytomic.com`
- URL: `https://app.polytomic.com/api/harbors/{harbor_id}/saved-queries`
- Auth: one of:
  - HTTP bearer
  - HTTP basic

Lists current published saved queries for a Harbor.

Saved queries are supported only for Polytomic-managed Harbors whose backing
Connection type is `polytomic_harbor`.

Collection items contain current published metadata and omit SQL, parameter
values, and unpublished drafts. A Harbor profile credential can list saved
queries only when `harbor_id` identifies its own Harbor.

## Harbor Activity

When you use a Harbor profile credential, send a new nonzero UUID in
`X-Polytomic-Activity-Request-ID` for each request, including each page. A
missing or invalid ID returns `400 Bad Request`. Reusing a consumed ID returns
`409 Conflict`.

If you supply `X-Polytomic-Harbor-Session`, the session must be active and bound
to your credential and Harbor. An invalid session returns `403 Forbidden`.
Direct scoped REST requests may omit the session header.

Polytomic records `saved_query.listed` before returning data. The event describes
only the returned page, including saved-query IDs, immutable revision IDs,
version numbers, and bounded name snapshots. Activity excludes SQL, parameter
values, and expected column names. If Polytomic cannot record the event, the
request returns `503 Service Unavailable` without saved-query data.

## Path parameters

- `harbor_id` string, uuid, required: Unique identifier of the Harbor

## Query parameters

- `limit` integer: Maximum number of saved queries to return
- `page_token` string: Opaque pagination cursor returned by the previous request

## Headers

- `X-Polytomic-Version` string
- `X-Polytomic-Harbor-Session` string: Harbor session token; when supplied, the session must be active and bound to this credential and Harbor.
- `X-Polytomic-Activity-Request-ID` string: New nonzero UUID for each request, required for scoped credentials; a reused value is rejected.

## Response `200`

OK

- HarborSavedQueryListEnvelope
  - `data` HarborSavedQueryMetadataResponse[], nullable: Saved queries on this page
    - `description` string: Business definition and usage notes
    - `expected_columns` string[], nullable: Expected ordered result-column names
    - `id` string, uuid: Stable saved-query identifier
    - `name` string: Human-readable saved-query name
    - `owner` string: Human-readable owner label
    - `published_at` string, date-time: When this version was published
    - `revision_id` string, uuid: Immutable identifier of this exact published definition
    - `updated_at` string, date-time: When this version's draft was last updated before publication
    - `version` integer: Current published version number
  - `pagination` PaginationDetails
    - `next_page_token` string: Token for fetching the next page of results

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Unprocessable Entity
- `500`: Internal Server Error
- `503`: Service Unavailable

## Changes

- **2026-10-22** `d80b0fdea14e`: 1 breaking, 1 warning, 1 info
  - the `pagination` response's property type changed from `object` to no type for status `200`
  - removed the optional property `pagination/next_page_token` from the response with the `200` status
  - added `#/components/schemas/PaginationDetails` to the `pagination` response property `allOf` list for the response status `200`
- **2026-09-14** `21557a3c149d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/polytomic/apis/polytomic-api/changes/api/harbors/:harbor_id/saved-queries/get.md)

---

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