At the cluster setting level, a user must enable lifecycle policies. As it is enabled in the cluster, so use the management API:
...
The preserve query argument on the COPY operations indicates leaving other persisted headers as they are.
...
Important
Re-transmit all
Policy-Lifecycle
headers to make them appear on the new object. It is recommended to use Content UI for editing policy rules.Currently, Swarm only supports expiration policies.
SeeS3 lifecycle policy examples. Note that Swarm currently only supports expiration policies.