Skip to content

Undo the latest local PCD change

POST
/pcd/{databaseId}/overrides/undo
curl --request POST \
--url https://example.com/api/v1/pcd/1/overrides/undo \
--header 'Content-Type: application/json' \
--data '{ "expectedActionId": "example" }'

Soft-drops exactly the latest published user-action unit and recompiles the PCD. Every mutating HTTP request is one action_id unit; a scheduled or manual job run is its own unit, and each automatic conflict override applied during recompilation is a separate unit. Legacy ops fall back to group_id, then a single op. Previously applied edits superseded by this action are reactivated when undoing it; undoing a manual or automatic conflict override reactivates the original published op it replaced, and its previously pending conflict may return after the recompile. No automatic snapshot is created. API tokens require admin scope. The request body is limited to 8 KB. snapshot is created. API tokens require admin scope. The request body is limited to 8 KB.

databaseId
required
integer
>= 1

PCD database ID

Media typeapplication/json
object
expectedActionId

LastAction.actionId from the last read; mismatch is rejected as stale_action

string
>= 1 characters <= 64 characters
Examplegenerated
{
"expectedActionId": "example"
}

Latest user action undone and cache recompiled

Media typeapplication/json
object
databaseId
required
integer
undoneActionId
required
string
revertedOpIds
required
Array<integer>
reactivatedOpIds
required

Previously applied edits superseded by the undone action and now restored, including the original published op behind an undone manual or automatic conflict override

Array<integer>
entities
required
Array<object>
object
entityType
required

Resolved config entity type

string
Allowed values: delayProfile regularExpression customFormat qualityProfile naming mediaSettings qualityDefinitions lidarrMetadataProfile
arrType
required

Explicit Arr app for scoped entities; null for Arr-agnostic entities

string
nullable
Allowed values: radarr sonarr lidarr
name
required

Current resolved entity name, preserved exactly without trimming

string
>= 1 characters
Example
{
"entities": [
{
"entityType": "delayProfile",
"arrType": "radarr"
}
]
}

Invalid databaseId or JSON body, oversized body, disabled database, or unbuilt cache

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"
}

Authentication required

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"
}

The API token lacks the admin scope.

Media typeapplication/json

An authenticated API token lacks the scope the requested route requires.

object
error
required

Always Forbidden.

string
requiredScope
required

The API token scope this request requires.

string
Allowed values: read mcp sync:apply admin
Example
{
"requiredScope": "read"
}

Nothing_to_undo means there are no published user ops to undo

Media typeapplication/json
object
error
required
string
reason
required

Machine-readable missing-target (404) or fail-closed conflict (409) reason

string
Allowed values: entity_not_found op_not_found nothing_to_undo group_dependency dependent_ops selection_blocked op_not_revertible conflict_after_revert collateral_ops stale_action
blockingOpIds
Array<integer>
entities
Array<object>
object
entityType
required

Resolved config entity type

string
Allowed values: delayProfile regularExpression customFormat qualityProfile naming mediaSettings qualityDefinitions lidarrMetadataProfile
arrType
required

Explicit Arr app for scoped entities; null for Arr-agnostic entities

string
nullable
Allowed values: radarr sonarr lidarr
name
required

Current resolved entity name, preserved exactly without trimming

string
>= 1 characters
Example
{
"reason": "entity_not_found",
"entities": [
{
"entityType": "delayProfile",
"arrType": "radarr"
}
]
}

Undo rejected without changing the published-op set:

  • stale_action: expectedActionId no longer identifies the latest undoable action.
  • conflict_after_revert: recompilation would introduce a new conflict on a remaining op.
  • collateral_ops: recompilation would change ops outside the explicitly planned set.
Media typeapplication/json
object
error
required
string
reason
required

Machine-readable missing-target (404) or fail-closed conflict (409) reason

string
Allowed values: entity_not_found op_not_found nothing_to_undo group_dependency dependent_ops selection_blocked op_not_revertible conflict_after_revert collateral_ops stale_action
blockingOpIds
Array<integer>
entities
Array<object>
object
entityType
required

Resolved config entity type

string
Allowed values: delayProfile regularExpression customFormat qualityProfile naming mediaSettings qualityDefinitions lidarrMetadataProfile
arrType
required

Explicit Arr app for scoped entities; null for Arr-agnostic entities

string
nullable
Allowed values: radarr sonarr lidarr
name
required

Current resolved entity name, preserved exactly without trimming

string
>= 1 characters
Example
{
"reason": "entity_not_found",
"entities": [
{
"entityType": "delayProfile",
"arrType": "radarr"
}
]
}

Failed to undo the latest local change

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"
}