---
title: "Change a saved log search."
method: PATCH
path: "/projects/{project_id}/logs/saved-searches/{saved_search_id}"
tags: ["Logs"]
---

# Change a saved log search.

`PATCH /projects/{project_id}/logs/saved-searches/{saved_search_id}`

## 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/{saved_search_id}`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required
- `saved_search_id` integer, required

## Request body

- UpdateSavedSearchRequest
  - `description` string, nullable: Absent leaves the description unchanged; an empty string clears it.
  - `name` string, nullable: Absent leaves the name unchanged.
  - `pinned` boolean, nullable
  - `query` SavedSearchQuery, nullable: 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, nullable

## Response `200`

Saved search updated

- SavedSearchResponse
  - `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

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Saved search not found
- `409`: Name taken
- `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/:saved_search_id/patch.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)
