Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Query
  • Access management
  • Pricing policy
    • SDK
      • Overview
      • Authentication
        • All methods
        • create-query
        • get-query
        • get-query-status
        • stop-query
        • get-query-results
      • YQL and JSON type mapping
    • Apache Airflow™
  • Integration
  • Audit Trails events
  • FAQ

In this article:

  • Request
  • Response
  • Example
  1. Reference
  2. HTTP API
  3. Methods
  4. create-query

create-query

Written by
Yandex Cloud
Updated at October 28, 2024
  • Request
  • Response
  • Example

The method creates a data query and runs it. After that, the query status changes to RUNNING. You can only get results once the query completes successfully. To find out the query status, use the get-query-status method.

When using the HTTP API, authenticate and specify the required headers. You can also specify optional headers for setting up request execution. The HTTP API may return errors while running.

RequestRequest

POST request to /queries?project={folder_id}, where {folder_id} is a folder ID.

The request body contains data in JSON format:

{
  "name": "human readable default name",
  "type": "ANALYTICS",
  "text": "string",
  "description": ""
}
Field Description Acceptable values Comment Limitations
name Query name If the parameter is not specified, it is assigned the default name. The length must not exceed 1024 bytes.
type Query type STREAMING for streaming queries, ANALYTICS for analytical ones Default value: ANALYTICS
text Query text String Required The length must be from 1 to 102400 bytes.
description Query description The default value is an empty string. The length must not exceed 10240 bytes.

ResponseResponse

If successful, the HTTP code 200 and query ID are returned.

{
  "id": "string"
}
Field Description Comment
id ID of the created query Required

ExampleExample

Request:

curl \
  --request 'POST' \
  'https://api.yandex-query.cloud.yandex.net/api/fq/v1/queries?project=b1gaue5b382m********' \
  --header 'accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Test query",
    "type": "ANALYTICS",
    "text": "select 1",
    "description": ""
  }'

Response:

{
  "id": "csqugo80f0l3********"
}

Was the article helpful?

Previous
All methods
Next
get-query
Yandex project
© 2025 Yandex.Cloud LLC