---
title: "create new query"
method: POST
path: "/queries"
---

# create new query

`POST /queries`

## Query parameters

- `db` string
- `project` string

## Headers

- `Idempotency-Key` string
- `Authorization` string
- `x-request-id` string

## Request body

- object
  - `name` string
  - `type` 'ANALYTICS' | 'STREAMING'
  - `text` string, required
  - `description` string

## Response `200`

OK

- object
  - `id` string, required

## Other responses

- `400` — Bad Request

## Changes

- **2022-11-24** `a67282f76c41` — 1 warning
  - removed the optional property `details/items/status` from the response with the `400` status
- **2022-11-10** `88d79b1ba69f` — 1 info
  - added the optional property `details/items/status` to the response with the `400` status

[Change history](https://skmtc.dev/shmel1k/apis/yq/changes/queries/post.md)

---

[API](https://skmtc.dev/shmel1k/apis/yq.md) · [All operations](https://skmtc.dev/shmel1k/apis/yq/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/shmel1k/yq/revisions/036b0af69dee/schema)
