Apply a policy to a create index requestedit

The index.lifecycle.name setting can be set on an individual create index request so ILM immediately starts managing the index:

PUT test-index
{
  "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 1,
    "index.lifecycle.name": "my_policy"
  }
}
Important

Its recommended not to use the create index API with a policy that defines a rollover action. If you do so, the new index as the result of the rollover will not carry forward the policy. Always use index templates to define policies with rollover actions.