Yandex Cloud
Поиск
Связаться с экспертомПопробовать бесплатно
  • Кейсы
  • Документация
  • Блог
  • Все сервисы
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • VibeCraft
    • Yandex Cloud Detection and Response
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • GOST Gateway
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • SourceCraft
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • Статус работы сервисов
  • Marketplace
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Искусственный интеллект
    • Безопасность
    • Инструменты DevOps
    • Бессерверные вычисления
    • Управление ресурсами
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Калькулятор цен
    • Тарифы
    • Акции и free tier
  • Кейсы
  • Документация
  • Блог
Сделано на Gravity UI
Проект Яндекса
© 2026 ООО «Яндекс.Облако»
Yandex DataLens
  • Галерея в DataLens
    • Как пользоваться Public API
    • Версионирование
    • История изменений
      • Overview
        • Overview
        • 🚧 [Experimental] Get SQL query
        • 🚧 [Experimental] Create SQL query
        • 🚧 [Experimental] Update SQL query
        • 🚧 [Experimental] Delete SQL query
        • 🚧 [Experimental] Run SQL query
  • Аудитные логи Audit Trails

В этой статье:

  • Request
  • Headers
  • Body
  • Responses
  • 200 OK
  • Body
  1. DataLens Public API
  2. DataLens API (англ.)
  3. SqlQueries
  4. 🚧 [Experimental] Run SQL query
Статья создана
Yandex Cloud
Открыть в Markdown
  • Request
    • Headers
    • Body
  • Responses
  • 200 OK
    • Body

🚧 [Experimental] Run SQL query

Runs the specified saved SQL query and returns its result.

RequestRequest

POST

https://api.datalens.tech/rpc/runSqlQuery

HeadersHeaders

Name

Description

x-dl-api-version

Type: string

API version header.

Const: 3

Example: 3

BodyBody

application/json
{
  "sqlQueryId": "example",
  "params": {}
}

Name

Description

sqlQueryId

Type: string

ID of the SQL query to run.

Example: example

params

Type: object

[additional]

Any of 5 types
  • Type: string

    Example: example

  • Type: number

  • Type: boolean

  • Type: array
    Any of 3 types
    • Type: string

      Example: example

    • Type: number

    • Type: boolean

    Example
    [
      "example"
    ]
    
  • Type: object

    from

    Type: string

    Start of the interval.

    Example: example

    to

    Type: string

    End of the interval.

    Example: example

    Example
    {
      "from": "example",
      "to": "example"
    }
    

Example: example

Values of the query parameters, keyed by name. A parameter left out here falls back to its default value.

Example
{}

ResponsesResponses

200 OK200 OK

Response

BodyBody

application/json
{
  "id": "example",
  "connectionId": "example",
  "tenantId": "example",
  "status": "success",
  "query": "example",
  "statementPositions": [
    [
      null
    ]
  ],
  "results": [
    {
      "status": "success",
      "columns": [
        {}
      ],
      "rows": [
        [
          null
        ]
      ],
      "hasMoreRows": true,
      "affectedRows": 0.5
    }
  ],
  "createdBy": "example",
  "createdAt": "example",
  "updatedAt": "example"
}

Name

Description

connectionId

Type: string

ID of the connection the query was executed on.

Example: example

createdAt

Type: string

Date and time when the query run was created.

Example: example

createdBy

Type: string

ID of the user who ran the query.

Example: example

id

Type: string

ID of the query run.

Example: example

query

Type: string

Text of the executed query.

Example: example

results

Type: array
Any of 2 types
  • Type: object

    columns

    Type: object[]

    name

    Type: string

    Name of the column.

    Example: example

    Columns of the statement result. Empty for statements that return no rows.

    Example
    [
      {
        "name": "example"
      }
    ]
    

    hasMoreRows

    Type: boolean

    Whether the statement returned more rows than included in rows.

    rows

    Type: array
    Any of 5 types
    • Type: string

      Example: example

    • Type: number

    • Type: boolean

    • Type: null

      Example: null

    • Type: null

      Example: null

    Rows of the statement result, with values in the order of the columns.

    Example
    [
      [
        "example"
      ]
    ]
    

    status

    Type: string

    Status of the statement.

    Const: success

    Example: example

    affectedRows

    Type: number

    Number of rows affected by the statement.

    Example
    {
      "status": "success",
      "columns": [
        {
          "name": "example"
        }
      ],
      "rows": [
        [
          "example"
        ]
      ],
      "hasMoreRows": true,
      "affectedRows": 0.5
    }
    
  • Type: object

    code

    Type: string

    Error code.

    Example: example

    message

    Type: string

    Error message.

    Example: example

    status

    Type: string

    Status of the statement.

    Const: error

    Example: example

    databaseMessage

    Type: string

    Message returned by the database.

    Example: example

    Example
    {
      "status": "error",
      "code": "example",
      "message": "example",
      "databaseMessage": "example"
    }
    

Results of the executed statements, in the order of the statements.

Example
[
  {
    "status": "success",
    "columns": [
      {
        "name": "example"
      }
    ],
    "rows": [
      [
        null
      ]
    ],
    "hasMoreRows": true,
    "affectedRows": 0.5
  }
]

statementPositions

Type: unknown[][]

Start and end indexes of the executed statements.

Example
[
  [
    null
  ]
]

status

Type: string

Status of the query run.

Enum: success, error, pending, partial_success

tenantId

Type: string

ID of the DataLens tenant.

Example: example

updatedAt

Type: string

Date and time when the query run was updated.

Example: example

Была ли статья полезна?

Предыдущая
🚧 [Experimental] Delete SQL query
Следующая
Overview
Сделано на Gravity UI
Проект Яндекса
© 2026 ООО «Яндекс.Облако»