Scan or execute cleanup of stale configs
const url = 'https://example.com/api/v1/arr/cleanup';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"instanceId":1,"action":"scan"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/arr/cleanup \ --header 'Content-Type: application/json' \ --data '{ "instanceId": 1, "action": "scan" }'Detects and deletes stale namespace-suffixed custom formats and quality profiles from an Arr instance that are no longer in the current sync selections.
Two actions are supported via the action field in the request body:
scan: Scans for stale items and returns what would be deleted.execute: Deletes the stale items from a previous scan result.
Quality profiles assigned to media will be skipped with a warning (Arr returns HTTP 500 “in use”).
Request Bodyrequired
Section titled “Request Bodyrequired”object
Arr instance ID
object
Arr instance ID
object
Custom formats that are no longer in sync selections
object
Arr entity ID
Full name including namespace suffix
Name with namespace suffix removed
Quality profiles that are no longer in sync selections
object
Arr entity ID
Full name including namespace suffix
Name with namespace suffix removed
Responses
Section titled “Responses”Scan or delete result
object
Custom formats that are no longer in sync selections
object
Arr entity ID
Full name including namespace suffix
Name with namespace suffix removed
Quality profiles that are no longer in sync selections
object
Arr entity ID
Full name including namespace suffix
Name with namespace suffix removed
object
Custom formats that were successfully deleted
object
Arr entity ID
Full name including namespace suffix
Name with namespace suffix removed
Quality profiles that were successfully deleted
object
Arr entity ID
Full name including namespace suffix
Name with namespace suffix removed
Quality profiles that were skipped (assigned to media)
object
object
Arr entity ID
Full name including namespace suffix
Name with namespace suffix removed
Why the item was skipped (e.g. “Profile is assigned to media”)
Examplegenerated
{ "staleCustomFormats": [ { "id": 1, "name": "example", "strippedName": "example" } ], "staleQualityProfiles": [ { "id": 1, "name": "example", "strippedName": "example" } ]}Invalid request (missing instanceId, invalid action)
object
Error message
Examplegenerated
{ "error": "example"}Instance not found
object
Error message
Examplegenerated
{ "error": "example"}Failed to perform cleanup
object
Error message
Examplegenerated
{ "error": "example"}