Elastic Stack (ELK Stack) Script API

The script API from Elastic Stack (ELK Stack) — 5 operation(s) for script.

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
“How can I see the source of a stored Painless script?”
“Can I retrieve a saved search template by its id?”
Tell an agent
Get stored script {id}.
Show the search template saved as {id}.
PUT /_scripts/{id} Store a script with PUT · Create or update a script or search template #
Ask an LLM
“How do I save a Painless script in the cluster state with a PUT request?”
“Can I store a search template under my own id?”
Tell an agent
PUT script {script} under id {id}.
Using PUT, save search template {script} as {id} for query context {context}.
POST /_scripts/{id} Store a script with POST · Create or update a script or search template #
Ask an LLM
“Can I create or update a stored script with POST instead of PUT?”
“Does POSTing to a script id overwrite the existing stored script?”
Tell an agent
POST script {script} to id {id} to create or replace it.
Via POST, store search template {script} as {id} with timeout {timeout}.
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 from the cluster?”
“What happens to searches that use a search template I delete?”
Tell an agent destructive · confirm first
Delete stored script {id}.
Remove search template {id}.
GET /_script_context List supported script contexts · Get script contexts #
Ask an LLM
“Which script contexts does Elasticsearch support, and what methods do they have?”
“Where can scripts run, such as score or ingest contexts?”
Tell an agent
List all supported script contexts and their methods.
Show the available Painless execution contexts.
GET /_script_language List available script languages · Get script languages #
Ask an LLM
“Which scripting languages are enabled on my cluster?”
“What script types and languages can each context use?”
Tell an agent
List the available script languages and types.
Show which languages each script context supports.
PUT /_scripts/{id}/{context} Store a script for a context with PUT · Create or update a script or search template #
Ask an LLM
“Can I compile and store a script against a specific context in the URL path using PUT?”
“How do I PUT a stored script scoped to a context like score?”
Tell an agent
PUT script {script} as {id} compiled for path context {context}.
Using PUT with a context segment, store {script} under {id} in context {context}.
POST /_scripts/{id}/{context} Store a script for a context with POST · Create or update a script or search template #
Ask an LLM
“Can I POST a stored script to a path that names its context?”
“Is there a POST variant for saving a script under a specific context?”
Tell an agent
POST script {script} as {id} to the {context} context path.
Via POST with a context segment, store {script} under {id} for {context}.
GET /_scripts/painless/_execute Test-run a Painless script with GET · Run a script #
Ask an LLM
“Can I test a Painless script with a GET request before using it in a runtime field?”
“Is there a GET endpoint that executes a script and returns its result?”
Tell an agent
Using GET, run Painless script {script} and return its result.
With a GET request, test script {script} in context {context}.
POST /_scripts/painless/_execute Test-run a Painless script with POST · Run a script #
Ask an LLM
“How do I POST a Painless script to execute it and see the output?”
“Can I try out a script against a sample document setup without write access?”
Tell an agent
POST Painless script {script} to execute it.
Via POST, execute script {script} with context setup {context_setup}.

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/elk-stack:elk-stack-script-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

elk-stack-script-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Elasticsearch Request & Response Specification Script API
  license:
    name: Apache 2.0
    url: https://github.com/elastic/elasticsearch-specification/blob/main/LICENSE
  version: ''
tags:


# --- truncated at 32 KB (343 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/elk-stack/refs/heads/main/openapi/elk-stack-script-api-openapi.yml