---
title: "Saved Sql Queries Partial Update"
method: PATCH
path: "/clickhouse/saved-sql-queries/"
tags: ["clickhouse"]
---

# Saved Sql Queries Partial Update

`PATCH /clickhouse/saved-sql-queries/`

PATCH handler with superadmin lock and field protection.

Checks:
1. Object lock (is_managed=True -> non-superadmins can't modify)
2. Field protection (non-superadmins can't modify specific fields)

## Headers

- `Authorization` string, required

## Request body

- PatchedSavedSQLQueryCreateRequest — Shared validation for create/update serializers.
  - `name` string
  - `description` string
  - `query` string
  - `plotting_config` union
    - unknown
    - unknown
  - `source` 'sql_editor' | 'dashboard_custom_chart' — * `sql_editor` - SQL editor * `dashboard_custom_chart` - Dashboard custom chart
  - `organization` integer
  - `project` string, nullable

## Response `200`

- SavedSQLQueryCreate — Shared validation for create/update serializers.
  - `id` string, required
  - `name` string, required
  - `description` string
  - `query` string, required
  - `plotting_config` union
    - unknown
    - unknown
  - `source` 'sql_editor' | 'dashboard_custom_chart' — * `sql_editor` - SQL editor * `dashboard_custom_chart` - Dashboard custom chart
  - `created_by` integer, nullable, required

---

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