Elastic Script API

Use the script support APIs to get a list of supported script contexts and languages. Use the stored script APIs to manage stored scripts and search templates.

GitHub OpenAPI

Operations 10

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

GET /_scripts/{id} Get a stored script or search template · Get a script or search template #
Ask an LLM
“What's the source of a stored script?”
“Can I view a saved search template by ID?”
Tell an agent
Show stored script {id}.
Get search template {id}.
PUT /_scripts/{id} Store a script or search template · Create or update a script or search template #
Ask an LLM
“How do I save a Painless script for reuse?”
“Can I store a search template in the cluster?”
Tell an agent
Store script {id} with source {script}.
Save search template {id} as {script}.
POST /_scripts/{id} Store a script via POST · Create or update a script or search template #
Ask an LLM
“Is there a POST form for saving a stored script?”
“Can I update a stored script with a POST call?”
Tell an agent
Post stored script {id} with source {script}.
Update script {id} to {script} using the POST form.
DELETE /_scripts/{id} Delete a stored script or search template · Delete a script or search template #
Ask an LLM
“How do I remove a stored script?”
“Can I delete a search template I no longer use?”
Tell an agent destructive · confirm first
Delete stored script {id}.
Remove search template {id}.
GET /_script_context List script contexts · Get script contexts #
Ask an LLM
“Which contexts can scripts run in?”
“What script contexts does this cluster support?”
Tell an agent
List all script contexts.
Show available script contexts.
GET /_script_language List script languages · Get script languages #
Ask an LLM
“Which scripting languages are available?”
“What languages work in each script context?”
Tell an agent
List supported script languages.
Show script languages and their contexts.
PUT /_scripts/{id}/{context} Store a script compiled for a context · Create or update a script or search template #
Ask an LLM
“Can I compile a stored script against a specific context when saving it?”
“How do I save a script for the score context?”
Tell an agent
Store script {id} in context {context} with source {script}.
Save script {id} compiled for {context}.
POST /_scripts/{id}/{context} Store a context script via POST · Create or update a script or search template #
Ask an LLM
“Is there a POST form for saving a script in a specific context?”
“Can I post a script with its context in the path?”
Tell an agent
Post script {id} for context {context} with source {script}.
Update context {context} script {id} using the POST form.
GET /_scripts/painless/_execute Test a Painless script · Run a script #
Ask an LLM
“Can I try a Painless script and see the result without indexing?”
“How do I test a script against a sample document?”
Tell an agent
Run Painless script {script}.
Test script {script} in context {context}.
POST /_scripts/painless/_execute Test a Painless script via POST · Run a script #
Ask an LLM
“Is there a POST form of the Painless execute API?”
“Can I post a script with context setup to debug it?”
Tell an agent
Post Painless script {script} for execution.
Test script {script} with setup {setup} using the POST form.

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-script-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-script-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Elasticsearch Script 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 (387 KB total) ---
# Full source: https://artifacts.apis.io/elastic/openapi/elastic-script-api-openapi.yml