---
title: "List a project's saved log searches, pinned first."
method: GET
path: "/projects/{project_id}/logs/saved-searches"
tags: ["Logs"]
---

# List a project's saved log searches, pinned first.

`GET /projects/{project_id}/logs/saved-searches`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/logs/saved-searches`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required

## Query parameters

- `page` integer, nullable
- `page_size` integer, nullable

## Response `200`

Saved searches

- SavedSearchesResponse
  - `data` SavedSearchResponse[], required
    - `alert_count` integer, required: Log alert rules counting this search. A search with alerts cannot be deleted until they are detached, so the console can say so before offering the button.
    - `created_at` string, date-time, required
    - `created_by` integer, nullable
    - `description` string, nullable
    - `id` integer, required
    - `name` string, required
    - `pinned` boolean, required
    - `project_id` integer, required
    - `query` SavedSearchQuery, required: The stored filter set of a saved search. Mirrors `GlobalLogSearchRequest` without `start_time`/`end_time`, `cursor`, `page_size` and the project selector: the window is the caller's and the project is the row's. External services are held as ids rather than names so counting a saved search needs no control-plane name resolution.
      - `attrs` string[]: Attribute predicates in the wire form the search endpoints take: `<key><op><value>` with `op` one of `=`, `!=`, `^=`, `>`, `<`, or `<key>?` for "exists".
      - `container_ids` string[]
      - `deploy_id` integer, nullable
      - `envs` string[]: Environment identifiers as the store holds them.
      - `external_service_ids` integer[]: Narrow to these of the project's external services (databases, imported services). Empty means every source allowed by `source`.
      - `levels` LogLevel[]
      - `node_ids` integer[]
      - `services` string[]: Container service labels (`web`, `worker`).
      - `source` 'collected' | 'application' | 'service': Which family of sources to search: everything the project has (`collected`), its application containers, or its databases.
      - `text` string, nullable: Case-insensitive substring match over the message.
    - `time_range` string, required
    - `updated_at` string, date-time, required
  - `page` integer, required
  - `page_size` integer, required
  - `time_ranges` string[], required: Allowed `time_range` values, so a client never has to hard-code them.
  - `total` integer, required

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions
- `500`: Internal server error

## Changes

- **2026-11-21** `d57a37c13a27`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/logs/saved-searches/get.md)

---

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