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. Note too, that even in this case, it is necessary to re-transmit all Policy-Lifecycle headers that should appear on the new object. It is recommended to use the UI for editing policy rules.
SeeS3 lifecycle policy examples. Note that Swarm currently only supports expiration policies.