Elastic Sql API

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

GitHub OpenAPI

Operations 8

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /_sql/close Close an open SQL pagination cursor · Clear an SQL search cursor #
Ask an LLM
“How do I release a SQL cursor I'm done paging through?”
“Can I free server resources held by an unfinished SQL result set?”
Tell an agent
Close SQL cursor {cursor}.
Release the SQL pagination cursor {cursor} now.
DELETE /_sql/async/delete/{id} Delete an async SQL search · Delete an async SQL search #
Ask an LLM
“How do I cancel and remove an async SQL search and its results?”
“Can I delete stored results of a long-running SQL query?”
Tell an agent destructive · confirm first
Delete async SQL search {id}.
Cancel and discard async SQL query {id}.
GET /_sql/async/{id} Get results of an async SQL search · Get async SQL search results #
Ask an LLM
“How do I fetch the results of an async SQL query once it's done?”
“Can I get async SQL results as CSV?”
Tell an agent
Get results of async SQL search {id}.
Return async SQL results {id} in format {format}.
GET /_sql/async/status/{id} Check status of an async SQL search · Get the async SQL search status #
Ask an LLM
“Is my async SQL query still running?”
“Can I check an async SQL search's progress without pulling the results?”
Tell an agent
Check the status of async SQL search {id}.
Tell me whether async SQL query {id} has finished.
GET /_sql Run a SQL query using GET · Get SQL search results #
Ask an LLM
“Can I send a SQL query to Elasticsearch with a GET request?”
“Is the GET form of the SQL endpoint able to return results as a table?”
Tell an agent
Use GET to run SQL query {query}.
Run SQL {query} via GET and return format {format}.
POST /_sql Run a SQL query against Elasticsearch · Get SQL search results #
Ask an LLM
“How do I query my indices with SQL?”
“Can I page through SQL results with a cursor?”
Tell an agent
Run SQL query {query}.
Run {query} and return results in format {format}.
GET /_sql/translate Translate SQL into Query DSL using GET · Translate SQL into Elasticsearch queries #
Ask an LLM
“Is there a GET version of the SQL translate endpoint?”
“Can I translate SQL to Query DSL with a GET call?”
Tell an agent
Use GET to translate SQL {query} into Query DSL.
Translate {query} via GET with fetch size {fetch_size}.
POST /_sql/translate Translate SQL into Query DSL · Translate SQL into Elasticsearch queries #
Ask an LLM
“What Elasticsearch query DSL does my SQL statement turn into?”
“Can I convert a SQL statement into a search request I can reuse?”
Tell an agent
Translate SQL {query} into Query DSL.
Show the search request generated for SQL {query} in time zone {time_zone}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/elastic:elastic-sql-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

elastic-sql-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Elasticsearch Sql API
  description: 'Elasticsearch provides REST APIs that are used by the UI components and can be called directly to configure and access Elasticsearch features.

    ## Documentation source and versions

    This documentation is derived from the main branch of the elasticsearch-specification repository. It is provided under license Attribution-NonCommercial-NoDerivatives 4.0 International.

    This documentation contains work-in-progress information for future Elastic Stack releases.'
  license:
    name: Apache 2.0
    url: https://github.com/elastic/elasticsearch-specification/blob/main/LICENSE
  version: ''
security:
- apiKeyAuth: []
- basicAuth: []
- bearerAuth: []
tags:


# --- truncated at 32 KB (378 KB total) ---
# Full source: https://artifacts.apis.io/elastic/openapi/elastic-sql-api-openapi.yml