Render a search template

POST /_render/template/{id}

Render a search template as a search request body.

Path parameters

  • id string Required

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

application/json

Body

  • file string
  • params object

    Key-value pairs used to replace Mustache variables in the template. The key is the variable name. The value is the variable value.

    Hide params attribute Show params attribute object
    • * object Additional properties

      Additional properties are allowed.

  • source string

    An inline search template. Supports the same parameters as the search API's request body. These parameters also support Mustache variables. If no id or <templated-id> is specified, this parameter is required.

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

        Additional properties are allowed.

POST /_render/template/{id}
curl \
 -X POST http://api.example.com/_render/template/{id} \
 -H "Content-Type: application/json" \
 -d '{"file":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"source":"string"}'