Skip to content

Scan or execute cleanup of stale configs

POST
/arr/cleanup
curl --request POST \
--url https://example.com/api/v1/arr/cleanup \
--header 'Content-Type: application/json' \
--data '{ "instanceId": 1, "includeUnmanaged": true, "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: Re-scans server-side and deletes only the requested items whose id and name both match a currently stale item of the same kind. Requested items that are no longer stale are not deleted; they are reported with reason No longer stale; not deleted (custom formats in failedCustomFormats, quality profiles in skippedQualityProfiles).

Namespaces whose expected contents cannot currently be determined (missing PCD cache, or a selected TRaSH source with no cached data or a transform failure) are kept, never reported stale.

Quality profiles assigned to media will be skipped with a warning (Arr returns HTTP 500 “in use”).

Media typeapplication/json
One of:
object
instanceId
required

Arr instance ID

integer
includeUnmanaged

Include entities outside the ownership ledger. Defaults to false (managed entities only).

boolean
action
required
string
Allowed values: scan

Scan or delete result

Media typeapplication/json
One of:
object
staleCustomFormats
required

Custom formats that are no longer in sync selections

Array<object>
object
id
required

Arr entity ID

integer
name
required

Full name including namespace suffix

string
strippedName
required

Name with namespace suffix removed

string
staleQualityProfiles
required

Quality profiles that are no longer in sync selections

Array<object>
object
id
required

Arr entity ID

integer
name
required

Full name including namespace suffix

string
strippedName
required

Name with namespace suffix removed

string
Examplegenerated
{
"staleCustomFormats": [
{
"id": 1,
"name": "example",
"strippedName": "example"
}
],
"staleQualityProfiles": [
{
"id": 1,
"name": "example",
"strippedName": "example"
}
]
}

Invalid request (malformed JSON or non-object body, missing instanceId, invalid action, or missing/malformed scanResult for execute)

Media typeapplication/json
object
error
required

Error message

string
code

Stable machine-readable code present on 5xx responses; error is a fixed user-safe message, raw detail is logged server-side only

string
Allowed values: cleanup_failed library_fetch_failed episodes_fetch_failed releases_fetch_failed
Example
{
"code": "cleanup_failed"
}

Instance not found

Media typeapplication/json
object
error
required

Error message

string
code

Stable machine-readable code present on 5xx responses; error is a fixed user-safe message, raw detail is logged server-side only

string
Allowed values: cleanup_failed library_fetch_failed episodes_fetch_failed releases_fetch_failed
Example
{
"code": "cleanup_failed"
}

Failed to perform cleanup (fixed message with code cleanup_failed; raw error logged server-side)

Media typeapplication/json
object
error
required

Error message

string
code

Stable machine-readable code present on 5xx responses; error is a fixed user-safe message, raw detail is logged server-side only

string
Allowed values: cleanup_failed library_fetch_failed episodes_fetch_failed releases_fetch_failed
Example
{
"code": "cleanup_failed"
}