Get a script or search template

GET /_scripts/{id}

Retrieves a stored script or search template.

Path parameters

  • id string Required

    The identifier for the stored script or search template.

Query parameters

  • The period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. It can also be set to -1 to indicate that the request should never timeout.

Responses

GET /_scripts/{id}
curl \
 --request GET 'http://api.example.com/_scripts/{id}' \
 --header "Authorization: $API_KEY"
Response examples (200)
{
  "_id": "string",
  "found": true,
  "script": {
    "": "painless",
    "options": {
      "additionalProperty1": "string",
      "additionalProperty2": "string"
    },
    "source": "string"
  }
}