---
title: "Saved Sql Queries Create"
method: POST
path: "/clickhouse/saved-sql-queries/"
tags: ["clickhouse"]
---

# Saved Sql Queries Create

`POST /clickhouse/saved-sql-queries/`

POST handler with superadmin-only field protection.

Strips superadmin-only fields from non-superadmin requests before
delegating to OrganizationInjectionMixin.post() for org injection.

## Headers

- `Authorization` string, required

## Request body

- SavedSQLQueryCreateRequest — Shared validation for create/update serializers.
  - `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
  - `organization` integer
  - `project` string, nullable

## Response `201`

- 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/revisions/c26d550029f8/schema)
