We've rebuilt the Elastic API reference with a fresh design. Share your feedback.

Feedback on this page

  1. Docs /
  2. APIs /
  3. Elasticsearch Serverless API
View as Markdown
Download OpenAPI spec (JSON) Download OpenAPI spec (YAML)

SQL

Elasticsearch's SQL APIs enable you to run SQL queries on Elasticsearch indices and data streams.

Endpoints

6 endpoints

  • POST GET Get SQL search results /_sql
  • DELETE Delete an async SQL search /_sql/async/delete/{id}
  • GET Get the async SQL search status /_sql/async/status/{id}
  • GET Get async SQL search results /_sql/async/{id}
  • POST Clear an SQL search cursor /_sql/close
  • POST GET Translate SQL into Elasticsearch queries /_sql/translate
Learn more
Check out the overview and tutorials for the Elasticsearch SQL features.
On this page
  • Endpoints
Elastic Stack
Elasticsearch API Elasticsearch Serverless API Kibana API Kibana Serverless API Logstash API
Orchestration
Elastic Cloud API Elastic Cloud Billing API Elastic Cloud Connected API Elastic Cloud Enterprise API Elastic Cloud Monitoring API Elastic Cloud Serverless API
All APIs
  • Overview
  • Authentication
  • Operations
    • Behavioral analytics
      • Create a behavioral analytics collection event Deprecated
      • Get behavioral analytics collections Deprecated
      • Create a behavioral analytics collection Deprecated
      • Delete a behavioral analytics collection Deprecated
    • Cluster
      • Ping the cluster
      • Get cluster subsystem info
    • Compact and aligned text (CAT)
      • Get CAT help
      • Get a compact list of aliases
      • Get a compact list of component templates
      • Get a document count POSTGET
      • Get a compact list of indices
      • Get anomaly detection jobs
      • Get data frame analytics jobs
      • Get datafeeds
      • Get trained models
      • Get transform information
    • Connector
      • Get all connectors
      • Create a connector
      • Get all connector sync jobs
      • Create a connector sync job
      • Get a connector sync job
      • Delete a connector sync job
      • Cancel a connector sync job
      • Check in a connector sync job
      • Claim a connector sync job
      • Set a connector sync job error
      • Set the connector sync job stats
      • Get a connector
      • Create or update a connector
      • Delete a connector
      • Update the connector API key ID
      • Check in a connector
      • Update the connector configuration
      • Update the connector error field
      • Update the connector features
      • Update the connector filtering
      • Activate the connector draft filter
      • Update the connector draft filtering validation
      • Update the connector index name
      • Update the connector name and description
      • Update the connector is_native flag
      • Update the connector pipeline
      • Update the connector scheduling
      • Update the connector service type
      • Update the connector status
    • Data stream
      • Convert an index alias to a data stream
      • Update data streams
      • Get data streams
      • Create a data stream
      • Delete data streams
      • Get data stream lifecycles
      • Update data stream lifecycles
      • Get data stream mappings
      • Update data stream mappings
      • Get data stream options
      • Update data stream options
      • Get data stream settings
      • Update data stream settings
      • Get data stream lifecycle stats
      • Get the status for a data stream lifecycle
    • Document
      • Reindex documents
      • Throttle a reindex operation
      • Bulk index or delete documents POSTPUT
      • Create a new document in the index POSTPUT
      • Delete documents
      • Get a document by its ID
      • Create or update a document in an index POSTPUT
      • Delete a document
      • Check a document
      • Get multiple documents POSTGET
      • Get multiple term vectors POSTGET
      • Get a document's source
      • Check for a document source
      • Get term vector information POSTGET
      • Update a document
      • Update documents
    • Enrich
      • Get an enrich policy
      • Create an enrich policy
      • Delete an enrich policy
      • Run an enrich policy
    • EQL
      • Get the async EQL status
      • Get async EQL search results
      • Delete an async EQL search
      • Get EQL search results POSTGET
    • ES|QL
      • Run an ES|QL query
      • Run an async ES|QL query
      • Get async ES|QL query results
      • Delete an async ES|QL query
      • Stop async ES|QL query
      • Get ES|QL data sources
      • Create or update an ES|QL data source
      • Delete ES|QL data sources
      • Get ES|QL datasets
      • Create or update an ES|QL dataset
      • Delete ES|QL datasets
      • Get running ES|QL queries information
      • Get a specific running ES|QL query information
      • Get an ES|QL view
      • Create or update an ES|QL view
      • Delete an ES|QL view
    • Index
      • Update aliases and delete indices atomically
      • Get component templates
      • Create or update a component template POSTPUT
      • Delete component templates
      • Check component templates
      • Simulate an index template
      • Simulate an index
      • Get index templates
      • Create or update an index template POSTPUT
      • Delete an index template
      • Check index templates
      • Resolve indices POSTGET
      • Roll over to a new index
      • Get index information
      • Create an index
      • Delete indices
      • Check indices
      • Get aliases
      • Check aliases
      • Create or update an alias POSTPUT
      • Delete an alias
      • Get tokens from text analysis POSTGET
      • Add an index block
      • Remove an index block
      • Get mapping definitions
      • Update field mappings POSTPUT
      • Refresh an index POSTGET
      • Update index settings
      • Get index settings
      • Validate a query POSTGET
    • Inference
      • Get the inference region policy
      • Create or update the inference region policy
      • Delete the inference region policy
      • Perform non-streaming chat completion inference on the service
      • Perform streaming chat completion inference on the service
      • Perform completion inference on the service
      • Perform streaming completion inference on the service
      • Perform decision inference on the service
      • Perform document extraction inference on the service
      • Perform dense embedding inference on the service
      • Perform reranking inference on the service
      • Perform sparse embedding inference on the service
      • Perform text embedding inference on the service
      • Create a AI21 inference endpoint
      • Create an AlibabaCloud AI Search inference endpoint
      • Create an Amazon Bedrock inference endpoint
      • Create an Amazon SageMaker inference endpoint
      • Create an Anthropic inference endpoint
      • Create an Azure AI studio inference endpoint
      • Create an Azure OpenAI inference endpoint
      • Create a Cohere inference endpoint
      • Create an Contextual AI inference endpoint
      • Create a custom inference endpoint
      • Create a DeepSeek inference endpoint
      • Create an Elasticsearch inference endpoint
      • Create an ELSER inference endpoint Deprecated
      • Create a Fireworks AI inference endpoint
      • Create an Google AI Studio inference endpoint
      • Create a Google Vertex AI inference endpoint
      • Create a Groq inference endpoint
      • Create a Hugging Face inference endpoint
      • Get an inference endpoint
      • Perform inference on the service
      • Create an inference endpoint
      • Delete an inference endpoint
      • Update an inference endpoint
      • Create an JinaAI inference endpoint
      • Create a Llama inference endpoint
      • Create a Mistral inference endpoint
      • Create an Nvidia inference endpoint
      • Create an OpenAI inference endpoint
      • Create an OpenShift AI inference endpoint
      • Create a VoyageAI inference endpoint
      • Create a Watsonx inference endpoint
    • Info
      • Get cluster info
    • Ingest
      • Get pipelines
      • Create or update a pipeline
      • Delete pipelines
      • Simulate a pipeline POSTGET
      • Run a grok processor
      • Simulate data ingestion POSTGET
    • Licensing
      • Get license information
    • Logstash
      • Get Logstash pipelines
      • Create or update a Logstash pipeline
      • Delete a Logstash pipeline
    • Machine learning anomaly detection
      • Estimate job model memory usage
      • Get anomaly detection jobs configuration info
      • Create an anomaly detection job
      • Delete an anomaly detection job
      • Close anomaly detection jobs
      • Force buffered data to be processed Deprecated
      • Predict future behavior of a time series
      • Open anomaly detection jobs
      • Reset an anomaly detection job
      • Get anomaly detection job stats
      • Update an anomaly detection job
      • Get overall bucket results POSTGET
      • Get calendar configuration info POSTGET
      • Create a calendar
      • Delete a calendar
      • Get info about events in calendars
      • Add scheduled events to the calendar
      • Delete events from a calendar
      • Add anomaly detection job to calendar
      • Delete anomaly jobs from a calendar
      • Get datafeeds configuration info
      • Create a datafeed
      • Delete a datafeed
      • Preview a datafeed POSTGET
      • Start datafeeds
      • Get datafeed stats
      • Stop datafeeds
      • Update a datafeed
      • Get filters
      • Create a filter
      • Delete a filter
      • Update a filter
    • Machine learning data frame analytics
      • Evaluate data frame analytics
      • Get data frame analytics job configuration info
      • Create a data frame analytics job
      • Delete a data frame analytics job
      • Preview features used by data frame analytics POSTGET
      • Start a data frame analytics job
      • Get data frame analytics job stats
      • Stop data frame analytics jobs
      • Update a data frame analytics job
    • Machine learning trained model
      • Get trained model configuration info
      • Create a trained model
      • Delete an unreferenced trained model
      • Evaluate a trained model
      • Get trained models usage info
      • Create part of a trained model definition
      • Start a trained model deployment
      • Stop a trained model deployment
      • Update a trained model deployment
      • Create or update a trained model alias
      • Delete a trained model alias
      • Create a trained model vocabulary
    • Migration
      • Create an index from a source index POSTPUT
      • Cancel a migration reindex operation
      • Get the migration reindexing status
    • Project
      • Get tags POSTGET
      • Get project routing expressions
      • Create or update project routing expressions
      • Get a project routing expression
      • Create or update a project routing expression
      • Delete a project routing expression
    • Prometheus
      • Ingest Prometheus remote write data
      • Get Prometheus label values
      • Get Prometheus label names POSTGET
      • Get Prometheus metric metadata
      • Run a PromQL instant query POSTGET
      • Query Prometheus exemplars POSTGET
      • Run a PromQL range query POSTGET
      • Find Prometheus series POSTGET
      • Get Prometheus build information
    • Query rules
      • Get all query rulesets
      • Get a query ruleset
      • Create or update a query ruleset
      • Delete a query ruleset
      • Get a query rule
      • Create or update a query rule
      • Delete a query rule
      • Test a query ruleset
    • Reindex
      • Get information about all currently running reindex tasks
      • Get the status and progress of a specific reindex task
      • Cancel an ongoing reindex task
    • Script
      • Run a script POSTGET
      • Get a script or search template
      • Delete a script or search template
      • Create or update a script or search template POSTPUT
    • Search
      • Get the async search status
      • Get async search results
      • Delete an async search
      • Close a point in time
      • Render a search template POSTGET
      • Run a scrolling search POSTGET
      • Clear a scrolling search
      • Run an async search
      • Count search results POSTGET
      • Explain a document match result POSTGET
      • Get the field capabilities POSTGET
      • Evaluate kNN search settings POSTGET
      • Run multiple searches POSTGET
      • Run multiple templated searches POSTGET
      • Search a vector tile POSTGET
      • Open a point in time
      • Evaluate ranked search results POSTGET
      • Run a search POSTGET
      • Run a search with a search template POSTGET
      • Get terms in an index POSTGET
    • Search application
      • Get search applications
      • Get search application details
      • Create or update a search application
      • Delete a search application
      • Run a search application search POSTGET
    • Security
      • Authenticate a user
      • Find API keys with a query POSTGET
      • Find roles with a query POSTGET
      • Get API key information
      • Create an API key POSTPUT
      • Invalidate API keys
      • Bulk update API keys
      • Update an API key
      • Get builtin privileges
      • Get roles
      • Create or update roles POSTPUT
      • Delete roles
      • Create a service account token POSTPUT
      • Delete service account tokens
      • Check user privileges POSTGET
    • SQL
      • Get SQL search results POSTGET
      • Delete an async SQL search
      • Get the async SQL search status
      • Get async SQL search results
      • Clear an SQL search cursor
      • Translate SQL into Elasticsearch queries POSTGET
    • Streams
      • Get the status of streams
      • Disable a named stream
      • Enable a named stream
    • Synonyms
      • Get all synonym sets
      • Get a synonym set
      • Create or update a synonym set
      • Delete a synonym set
      • Get a synonym rule
      • Create or update a synonym rule
      • Delete a synonym rule
    • Task management
      • Get task information
    • Transform
      • Get node stats
      • Get transforms
      • Create a transform
      • Delete a transform
      • Preview a transform POSTGET
      • Reset a transform
      • Schedule a transform to start now
      • Start a transform
      • Get transform stats
      • Stop transforms
      • Update a transform
  • Types
    • Query DSL
      • Query
    • Aggregations
      • Aggregation
      • Aggregation result
    • Ingest
      • Processor
Elastic logo
  • Trademarks
  • Terms of Use
  • Privacy
  • Sitemap

© 2026 Elasticsearch B.V. All Rights Reserved.

This content is available in different formats for convenience only. All original licensing terms apply.

Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.

Notice at Collection | Your Privacy Choices