Render a search template

GET /_render/template/{id}

Render a search template as a search request body.

Path parameters

  • id string Required

    The ID of the search template to render. If no source is specified, this or the id request body parameter is required.

application/json

Body

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • template_output object Required
      Hide template_output attribute Show template_output attribute object
      • * object Additional properties
GET /_render/template/{id}
curl \
 --request GET 'http://api.example.com/_render/template/{id}' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '"{\n  \"id\": \"my-search-template\",\n  \"params\": {\n    \"query_string\": \"hello world\",\n    \"from\": 20,\n    \"size\": 10\n  }\n}"'
Request example
Run `POST _render/template`
{
  "id": "my-search-template",
  "params": {
    "query_string": "hello world",
    "from": 20,
    "size": 10
  }
}
Response examples (200)
{
  "template_output": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  }
}