# Create or update a policy **PUT /_slm/policy/{policy_id}** Create or update a snapshot lifecycle policy. If the policy already exists, this request increments the policy version. Only the latest version of a policy is stored. ## Required authorization * Index privileges: `manage` * Cluster privileges: `manage_slm` ## Servers - http://api.example.com: http://api.example.com () ## Authentication methods - Api key auth - Basic auth - Bearer auth ## Parameters ### Path parameters - **policy_id** (string) The identifier for the snapshot lifecycle policy you want to create or update. ### Query parameters - **master_timeout** (string) The period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to `-1`. - **timeout** (string) The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to `-1`. ### Body: application/json (object) - **config** (object) Configuration for each snapshot created by the policy. - **name** (string) Name automatically assigned to each snapshot created by the policy. Date math is supported. To prevent conflicting snapshot names, a UUID is automatically appended to each snapshot name. - **repository** (string) Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API. - **retention** (object) Retention rules used to retain and delete snapshots created by the policy. - **schedule** (string) Periodic or absolute schedule at which the policy creates snapshots. SLM applies schedule changes immediately. ## Responses ### 200 #### Body: application/json (object) - **acknowledged** (boolean) For a successful response, this value is always true. On failure, an exception is returned instead. [Powered by Bump.sh](https://bump.sh)