Apply a sync preview
const url = 'https://example.com/api/v1/sync/preview/example/apply';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"sections":["qualityProfiles"]}'};
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/sync/preview/example/apply \ --header 'Content-Type: application/json' \ --data '{ "sections": [ "qualityProfiles" ] }'Applies the selected sections from a previously generated preview to the target Arr instance.
Preview generation itself is read-only. Apply atomically claims the preview and selected section rows, then revalidates the exact reviewed instance, Arr family, section subset, effective configuration, desired PCD evidence, live Arr evidence, and material plan. Every selected section must match before any Arr write, confirmed outcome, or Sync History row is created.
A matching review executes through the existing section writers with the bound effective configuration. Private fingerprints, retained configuration, and raw comparison evidence are never returned by this endpoint.
The response reports only the aggregate job/run result. Preview entity changes remain planned evidence and are not per-entity confirmation of what succeeded.
Apply rejects previews that are too stale based on policy:
- warnings are returned when the preview is older than 5 minutes
- apply is blocked when staleness exceeds the hard threshold
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Preview snapshot ID
Request Body
Section titled “Request Body”object
Optional section filters for preview application
Responses
Section titled “Responses”Selected sections completed successfully or required no work
Result of executing the preview’s selected sections through the normal sync job
path. results describes the aggregate job/run outcome; outcomes carries the
confirmed, per-entity terminal results captured from the ACTUAL Arr writes
(issue #232) — these, not the planned preview changes, are execution proof.
object
True when the sync job succeeded or reported that no work was needed.
object
Terminal status returned by the sync job execution.
Aggregate human-readable output from the sync job.
Typed, closed, safe failure evidence for Sync Preview generate/apply. Replaces the
former free-form error strings. message and recoveryAction are pre-authored safe
copy drawn from a closed vocabulary — they NEVER contain raw exception text, Arr
response bodies, credentials, hostnames, or stack traces. Full diagnostics live only in
the sanitized server logs.
object
Closed vocabulary of Sync Preview generate/apply failure reasons. Each value is assigned by matching a thrown error’s TYPE/status (never by parsing message text), so no raw exception or secret-shaped string is ever transported:
unreachable: the Arr instance could not be reached (network/DNS/connection).timeout: the Arr instance did not respond in time.unauthorized: the Arr instance rejected the API key (HTTP 401/403).notFound: a required Arr resource was not found (HTTP 404).rejected: the Arr instance rejected the request (other HTTP 4xx).serverError: the Arr instance returned a server error (HTTP 5xx).sectionErrors: one or more sections failed to generate (top-level aggregate).executionFailed: the apply sync run did not complete successfully.stale: the preview is too old to apply safely.internalError: an unexpected error occurred (catch-all for untyped failures).
Safe, user-facing summary of the failure. Never raw exception or secret text.
Actionable next step the operator can take to recover.
Confirmed per-entity outcomes captured from the actual Arr writes. Present on both success and partial/failure responses so failed and skipped outcomes are never dropped.
A confirmed, per-entity terminal outcome captured from an actual Arr write
(issue #232). Exactly one is produced per attempted entity. Unlike the preview
EntityChange (planned intent), status proves what the Arr instance actually did.
object
Sync section handled by preview generation
Arr type of the target instance — set explicitly by the syncer, never inferred.
The kind of entity a confirmed outcome describes.
Stable identity — the unsuffixed PCD name (or subsection label for singletons).
The write attempted for an entity (intent). delete is reserved; no syncer emits it yet.
Terminal status of a per-entity Arr write, sourced ONLY from the write result:
success (resolved), failed (threw), skipped (intentionally not written).
Example
{ "results": { "status": "success", "failure": { "code": "unreachable" } }, "outcomes": [ { "section": "qualityProfiles", "arrType": "radarr", "entityType": "customFormat", "action": "create", "status": "success" } ]}Invalid request body
object
Error message
Examplegenerated
{ "error": "example"}Preview is missing, evicted, or no longer retained
object
Error message
Examplegenerated
{ "error": "example"}Preview lifecycle conflict or a selected section has an active claim
object
Error message
Examplegenerated
{ "error": "example"}Preview age policy blocked apply or reviewed evidence was invalidated before writes
Safe pre-write rejection when the selected reviewed plan is no longer verifiable. No Arr write was attempted, so this response never contains confirmed outcomes, Sync History identifiers, private fingerprints, retained configuration, or raw PCD/Arr evidence.
object
Sanitized recovery text stating that nothing was applied and directing the operator to generate and review a new preview.
Closed reason for rejecting reviewed execution before any write:
pcd_drift: desired PCD, source, mapping, or reviewed configuration changedarr_drift: material live Arr state changedpcd_and_arr_drift: both PCD-side and live Arr evidence changedscope_drift: the instance, Arr family, capability, or reviewed scope changedunverifiable_review: authoritative evidence could not be read or compared safely
Bounded changed source classes. Empty for scope or unverifiable failures when PCD-side or Arr-side drift cannot be attributed safely.
Exact selected sections whose reviewed execution was invalidated.
Always true because an invalidated review cannot be retried.
object
Typed, closed, safe failure evidence for Sync Preview generate/apply. Replaces the
former free-form error strings. message and recoveryAction are pre-authored safe
copy drawn from a closed vocabulary — they NEVER contain raw exception text, Arr
response bodies, credentials, hostnames, or stack traces. Full diagnostics live only in
the sanitized server logs.
object
Closed vocabulary of Sync Preview generate/apply failure reasons. Each value is assigned by matching a thrown error’s TYPE/status (never by parsing message text), so no raw exception or secret-shaped string is ever transported:
unreachable: the Arr instance could not be reached (network/DNS/connection).timeout: the Arr instance did not respond in time.unauthorized: the Arr instance rejected the API key (HTTP 401/403).notFound: a required Arr resource was not found (HTTP 404).rejected: the Arr instance rejected the request (other HTTP 4xx).serverError: the Arr instance returned a server error (HTTP 5xx).sectionErrors: one or more sections failed to generate (top-level aggregate).executionFailed: the apply sync run did not complete successfully.stale: the preview is too old to apply safely.internalError: an unexpected error occurred (catch-all for untyped failures).
Safe, user-facing summary of the failure. Never raw exception or secret text.
Actionable next step the operator can take to recover.
Example
{ "code": "pcd_drift", "changedEvidence": [ "pcd" ], "changedSections": [ "qualityProfiles" ], "regenerateRequired": true}The reviewed evidence matched but the write-time sync job failed, or an
unexpected internal failure occurred. A matched write-time failure uses
SyncPreviewApplyResponse and preserves confirmed outcomes and Sync
History correlation when present. An unexpected failure uses the typed,
sanitized SyncPreviewApplyErrorResponse.
Result of executing the preview’s selected sections through the normal sync job
path. results describes the aggregate job/run outcome; outcomes carries the
confirmed, per-entity terminal results captured from the ACTUAL Arr writes
(issue #232) — these, not the planned preview changes, are execution proof.
object
True when the sync job succeeded or reported that no work was needed.
object
Terminal status returned by the sync job execution.
Aggregate human-readable output from the sync job.
Typed, closed, safe failure evidence for Sync Preview generate/apply. Replaces the
former free-form error strings. message and recoveryAction are pre-authored safe
copy drawn from a closed vocabulary — they NEVER contain raw exception text, Arr
response bodies, credentials, hostnames, or stack traces. Full diagnostics live only in
the sanitized server logs.
object
Closed vocabulary of Sync Preview generate/apply failure reasons. Each value is assigned by matching a thrown error’s TYPE/status (never by parsing message text), so no raw exception or secret-shaped string is ever transported:
unreachable: the Arr instance could not be reached (network/DNS/connection).timeout: the Arr instance did not respond in time.unauthorized: the Arr instance rejected the API key (HTTP 401/403).notFound: a required Arr resource was not found (HTTP 404).rejected: the Arr instance rejected the request (other HTTP 4xx).serverError: the Arr instance returned a server error (HTTP 5xx).sectionErrors: one or more sections failed to generate (top-level aggregate).executionFailed: the apply sync run did not complete successfully.stale: the preview is too old to apply safely.internalError: an unexpected error occurred (catch-all for untyped failures).
Safe, user-facing summary of the failure. Never raw exception or secret text.
Actionable next step the operator can take to recover.
Confirmed per-entity outcomes captured from the actual Arr writes. Present on both success and partial/failure responses so failed and skipped outcomes are never dropped.
A confirmed, per-entity terminal outcome captured from an actual Arr write
(issue #232). Exactly one is produced per attempted entity. Unlike the preview
EntityChange (planned intent), status proves what the Arr instance actually did.
object
Sync section handled by preview generation
Arr type of the target instance — set explicitly by the syncer, never inferred.
The kind of entity a confirmed outcome describes.
Stable identity — the unsuffixed PCD name (or subsection label for singletons).
The write attempted for an entity (intent). delete is reserved; no syncer emits it yet.
Terminal status of a per-entity Arr write, sourced ONLY from the write result:
success (resolved), failed (threw), skipped (intentionally not written).
object
Typed, closed, safe failure evidence for Sync Preview generate/apply. Replaces the
former free-form error strings. message and recoveryAction are pre-authored safe
copy drawn from a closed vocabulary — they NEVER contain raw exception text, Arr
response bodies, credentials, hostnames, or stack traces. Full diagnostics live only in
the sanitized server logs.
object
Closed vocabulary of Sync Preview generate/apply failure reasons. Each value is assigned by matching a thrown error’s TYPE/status (never by parsing message text), so no raw exception or secret-shaped string is ever transported:
unreachable: the Arr instance could not be reached (network/DNS/connection).timeout: the Arr instance did not respond in time.unauthorized: the Arr instance rejected the API key (HTTP 401/403).notFound: a required Arr resource was not found (HTTP 404).rejected: the Arr instance rejected the request (other HTTP 4xx).serverError: the Arr instance returned a server error (HTTP 5xx).sectionErrors: one or more sections failed to generate (top-level aggregate).executionFailed: the apply sync run did not complete successfully.stale: the preview is too old to apply safely.internalError: an unexpected error occurred (catch-all for untyped failures).
Safe, user-facing summary of the failure. Never raw exception or secret text.
Actionable next step the operator can take to recover.
Example
{ "results": { "status": "success", "failure": { "code": "unreachable" } }, "outcomes": [ { "section": "qualityProfiles", "arrType": "radarr", "entityType": "customFormat", "action": "create", "status": "success" } ]}