| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | [[get-stored-script-api]]=== Get stored script API++++<titleabbrev>Get stored script</titleabbrev>++++Retrieves a <<script-stored-scripts,stored script>> or <<search-template,searchtemplate>>.////[source,console]----PUT _scripts/my-stored-script{  "script": {    "lang": "painless",    "source": """      TimestampHour date =  doc['@timestamp'].value;       return date.getHour()    """  }}----////[source,console]----GET _scripts/my-stored-script----// TEST[continued][[get-stored-script-api-request]]==== {api-request-title}`GET _scripts/<script-id>`[[get-stored-script-api-prereqs]]==== {api-prereq-title}* If the {es} {security-features} are enabled, you must have the `manage`<<privileges-list-cluster,cluster privilege>> to use this API.[[get-stored-script-api-path-params]]==== {api-path-parms-title}`<script-id>`::(Required, string)Identifier for the stored script or search template.[[get-stored-script-api-query-params]]==== {api-query-parms-title}include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
 |