Hello @djxx
The API Documentation is still outdated.
But I can guide you.
Create yourself a Cloudron API Token, see https://docs.cloudron.io/profile#api-tokens
Get your backup site ID
export CLOUDRON_ACCESS_TOKEN="YOUR_TOKEN_GOES_HERE"
curl "https://my.cloudron.dev/api/v1/backup_sites?page=1&per_page=1000&access_token=${CLOUDRON_ACCESS_TOKEN}"
Example Output:
{
"backupSites": [
{
"id": "3db47cce-dab7-46b6-9db3-1892ab14cd21",
"name": "default",
"provider": "filesystem",
"schedule": "00 00 23 * * *",
"format": "tgz",
"enableForUpdates": true,
"creationTime": "2025-10-10T08:12:57.000Z",
"ts": "2025-11-10T11:22:44.000Z",
"config": {
"backupDir": "/var/backups"
},
"limits": {
"memoryLimit": 1073741824,
"uploadPartSize": 10485760,
"syncConcurrency": 10,
"downloadConcurrency": 10,
"copyConcurrency": 10
},
"retention": {
"keepWithinSecs": 172800
},
"integrityKeyPair": {
"publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAZ18PRnLfQIf08IKl9bf9YkIHL7zT2eeeRJ8XuCx1+C0=\n-----END PUBLIC KEY-----\n"
},
"contents": null,
"encrypted": false,
"encryptedFilenames": false,
"encryptionPasswordHint": null
}
]
}
So the backup site ID is 3db47cce-dab7-46b6-9db3-1892ab14cd21.
Set the retention time in seconds:
export BACKUPSITE_ID="3db47cce-dab7-46b6-9db3-1892ab14cd21"
curl "https://my.cloudron.dev/api/v1/backup_sites/${BACKUPSITE_ID}/configure/retention?access_token=${CLOUDRON_ACCESS_TOKEN}" \
-H 'content-type: application/json' \
--data-raw '{"retention":{"keepWithinSecs":86400}}'
This will lead to a little buggy looking dashboard since there is no display option for values outside of the avaiable selections.
Normal 2 Days:
[image: 1767115149874-821b8ddd-60a8-49f5-bc09-2b7759c67048-image.png]
Set to 86400 seconds = 1 Day:
[image: 1767115188051-240788f1-b06c-408e-af32-4f346e3758d4-image.png]