Import a portable entity or entity bundle
const url = 'https://example.com/api/v1/pcd/import';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"databaseId":1,"layer":"user","entityType":"delay_profile","migration":{"format":"json","version":1,"source":"example"},"data":{"name":"example","rename":true,"standardEpisodeFormat":"example","dailyEpisodeFormat":"example","animeEpisodeFormat":"example","seriesFolderFormat":"example","seasonFolderFormat":"example","replaceIllegalCharacters":true,"colonReplacementFormat":"example","customColonReplacementFormat":"example","multiEpisodeStyle":"example"}}'};
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/pcd/import \ --header 'Content-Type: application/json' \ --data '{ "databaseId": 1, "layer": "user", "entityType": "delay_profile", "migration": { "format": "json", "version": 1, "source": "example" }, "data": { "name": "example", "rename": true, "standardEpisodeFormat": "example", "dailyEpisodeFormat": "example", "animeEpisodeFormat": "example", "seriesFolderFormat": "example", "seasonFolderFormat": "example", "replaceIllegalCharacters": true, "colonReplacementFormat": "example", "customColonReplacementFormat": "example", "multiEpisodeStyle": "example" } }'Deserializes a portable entity into PCD operations, creating the entity in the target database and layer.
The request body matches the export response format (entityType + data),
plus databaseId and layer to specify the target.
Optional migration metadata (format, version, source) can be provided
for hybrid JSON/YAML ingestion flows.
Name uniqueness is validated — importing an entity with a name that already exists will return a 400 error.
Bundle import: when the body contains a bundle key it is treated as a
PcdBundleImportRequest (the legacy single-entity path is not used). All
entities are written to the single requested layer as one undo unit.
dryRun: trueapplies the bundle against an ephemeral cache and returns aPcdBundleImportReportlisting creates, collisions and missing references. Nothing is written topcd_opsorpcd_op_history.collisionsselectsskip,renameoroverwritefor entities whose name already exists (case-insensitive), with an optional per-entity override keyed"<entityType>:<name>".- References (quality profile to custom format, custom format to regular expression) must resolve inside the bundle or the target database. On a real apply any unresolved reference returns 400 with the report before anything is written.
- A failure part-way through applying rolls back every operation the import
created and returns 500 with the report and
rolledBack: true. If the rollback itself failed, the database is disabled androlledBackis false. expectedPlanDigest: pass theplanDigestreturned by a dry run to reject the apply with HTTP 409 when the database changed in between.- Limits: at most 1000 entities and a 5 MiB JSON body (400 otherwise).
Request Bodyrequired
Section titled “Request Bodyrequired”object
The PCD database ID to import into
The operation layer to write to
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Optional migration metadata for hybrid imports. If provided, this field must
include all keys from PortableMigrationMetadata.
object
Migration payload format marker (json for JSON payloads, yaml for YAML
in future hybrid ingestion flows).
Migration schema contract version for hybrid payloads.
Migration source marker (example: pcd-export, pcd-file, pcd-importer).
object
object
object
Condition data (shape varies by condition type)
object
object
object
Ordered quality item (quality or group)
object
object
Arr target for this score mapping. lidarr is a first-class value
so quality profile custom-format scores can be scoped to a specific Arr
app family. all applies the score to every supported family.
Non-regression contract: existing radarr, sonarr, and all
enum semantics are unchanged; lidarr is an explicit additional arr
target value and does not introduce fallback alias behavior.
object
Portable naming payload for Sonarr entities.
object
Portable naming payload for lidarr_naming.
The wire shape matches PortableSonarrNaming (shared column structure).
Field semantics are Lidarr-native (artist/album/track tokens).
object
Shared media-management settings payload shape used across Arr families.
object
Portable payload for lidarr_media_settings.
The shape matches PortableMediaSettings.
object
Shared quality-definition payload shape used across Arr families.
object
Quality definition entry with min/max/preferred sizes
object
object
object
object
object
Portable payload for lidarr_quality_definitions.
The shape matches PortableQualityDefinitions.
object
Quality definition entry with min/max/preferred sizes
object
object
The PCD database ID to import into
The single operation layer every bundle entity is written to. base
requires a personal access token and local ops disabled (403 otherwise).
A set of portable PCD entities that can be exported together with their dependencies and imported atomically.
object
Bundle format version. Only 1 is supported.
Portable entities ordered dependency-first (regular expressions, custom formats, quality profiles, then all other entity types). A bundle holds at most 1000 entities and its JSON body is capped at 5 MiB.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
object
object
object
Condition data (shape varies by condition type)
object
object
object
Ordered quality item (quality or group)
object
object
Arr target for this score mapping. lidarr is a first-class value
so quality profile custom-format scores can be scoped to a specific Arr
app family. all applies the score to every supported family.
Non-regression contract: existing radarr, sonarr, and all
enum semantics are unchanged; lidarr is an explicit additional arr
target value and does not introduce fallback alias behavior.
object
Portable naming payload for Sonarr entities.
object
Portable naming payload for lidarr_naming.
The wire shape matches PortableSonarrNaming (shared column structure).
Field semantics are Lidarr-native (artist/album/track tokens).
object
Shared media-management settings payload shape used across Arr families.
object
Portable payload for lidarr_media_settings.
The shape matches PortableMediaSettings.
object
Shared quality-definition payload shape used across Arr families.
object
Quality definition entry with min/max/preferred sizes
object
object
object
object
object
Portable payload for lidarr_quality_definitions.
The shape matches PortableQualityDefinitions.
object
Quality definition entry with min/max/preferred sizes
object
When true the whole bundle is applied against an ephemeral cache and a
report is returned. Nothing is written to pcd_ops or pcd_op_history
and the live cache is not modified.
object
How an entity whose name already exists (case-insensitive) in the target database is handled:
skipleaves the existing entity untouched.renameimports under a unique"<name> (2)","<name> (3)", … name and rewrites bundle references (for example quality profile score entries) to it.overwriteupdates the existing entity in place with value-guarded update operations (never delete + create).
Per-entity overrides keyed by "<entityType>:<name>" (name matched
case-insensitively).
object
How an entity whose name already exists (case-insensitive) in the target database is handled:
skipleaves the existing entity untouched.renameimports under a unique"<name> (2)","<name> (3)", … name and rewrites bundle references (for example quality profile score entries) to it.overwriteupdates the existing entity in place with value-guarded update operations (never delete + create).
When set, the apply is rejected with HTTP 409 if the plan computed from the current database state does not match this digest (another write landed after the dry run).
Responses
Section titled “Responses”Entity created successfully, or bundle import report
object
object
Deterministic hash over the ordered plan outcomes and the target state they were
computed from. Pass back as expectedPlanDigest on the apply request to get a 409
when the plan no longer matches the database.
True only when a non-dry-run import wrote its operations.
True when a failure mid-apply was fully rolled back (HTTP 500).
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Entity name as it appears in the bundle.
Name the entity has (or would have) in the target database after import.
Present when action is error.
A reference (quality profile to custom format, custom format to regular expression) that resolves neither inside the bundle nor in the target database.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Example
{ "outcomes": [ { "entityType": "delay_profile", "action": "create" } ], "missingReferences": [ { "fromType": "delay_profile", "toType": "delay_profile" } ], "errors": [ { "entityType": "delay_profile" } ]}Validation error (missing fields, duplicate name, invalid data, bundle caps, unresolved references)
object
Optional machine-readable error code, for example sync_in_progress or preview_stale
object
object
Deterministic hash over the ordered plan outcomes and the target state they were
computed from. Pass back as expectedPlanDigest on the apply request to get a 409
when the plan no longer matches the database.
True only when a non-dry-run import wrote its operations.
True when a failure mid-apply was fully rolled back (HTTP 500).
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Entity name as it appears in the bundle.
Name the entity has (or would have) in the target database after import.
Present when action is error.
A reference (quality profile to custom format, custom format to regular expression) that resolves neither inside the bundle nor in the target database.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
True when a mid-apply failure was fully rolled back (HTTP 500).
Present on HTTP 400 when references resolve neither in the bundle nor the target database.
A reference (quality profile to custom format, custom format to regular expression) that resolves neither inside the bundle nor in the target database.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Example
{ "report": { "outcomes": [ { "entityType": "delay_profile", "action": "create" } ], "missingReferences": [ { "fromType": "delay_profile", "toType": "delay_profile" } ], "errors": [ { "entityType": "delay_profile" } ] }, "missingReferences": [ { "fromType": "delay_profile", "toType": "delay_profile" } ]}Cannot write to base layer
object
Optional machine-readable error code, for example sync_in_progress or preview_stale
Examplegenerated
{ "error": "example", "code": "example"}The plan digest no longer matches the database (run a new dry run)
object
object
Deterministic hash over the ordered plan outcomes and the target state they were
computed from. Pass back as expectedPlanDigest on the apply request to get a 409
when the plan no longer matches the database.
True only when a non-dry-run import wrote its operations.
True when a failure mid-apply was fully rolled back (HTTP 500).
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Entity name as it appears in the bundle.
Name the entity has (or would have) in the target database after import.
Present when action is error.
A reference (quality profile to custom format, custom format to regular expression) that resolves neither inside the bundle nor in the target database.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
True when a mid-apply failure was fully rolled back (HTTP 500).
Present on HTTP 400 when references resolve neither in the bundle nor the target database.
A reference (quality profile to custom format, custom format to regular expression) that resolves neither inside the bundle nor in the target database.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Example
{ "report": { "outcomes": [ { "entityType": "delay_profile", "action": "create" } ], "missingReferences": [ { "fromType": "delay_profile", "toType": "delay_profile" } ], "errors": [ { "entityType": "delay_profile" } ] }, "missingReferences": [ { "fromType": "delay_profile", "toType": "delay_profile" } ]}Database cache not available, or bundle apply failed and was rolled back
object
Optional machine-readable error code, for example sync_in_progress or preview_stale
object
object
Deterministic hash over the ordered plan outcomes and the target state they were
computed from. Pass back as expectedPlanDigest on the apply request to get a 409
when the plan no longer matches the database.
True only when a non-dry-run import wrote its operations.
True when a failure mid-apply was fully rolled back (HTTP 500).
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Entity name as it appears in the bundle.
Name the entity has (or would have) in the target database after import.
Present when action is error.
A reference (quality profile to custom format, custom format to regular expression) that resolves neither inside the bundle nor in the target database.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
True when a mid-apply failure was fully rolled back (HTTP 500).
Present on HTTP 400 when references resolve neither in the bundle nor the target database.
A reference (quality profile to custom format, custom format to regular expression) that resolves neither inside the bundle nor in the target database.
object
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Portable PCD entity identifiers used by import/export endpoints.
Lidarr media-management entities are first-class portable contract members:
lidarr_naminglidarr_media_settingslidarr_quality_definitions
Runtime validation is deterministic and fail-fast for Lidarr payloads:
payloads are rejected when required fields are missing, when unsupported
fields are present, or when cross-family fields are mixed into the payload
(for example Radarr naming fields with lidarr_naming).
Clients must emit lidarr_* entity types for Lidarr entities.
Example
{ "report": { "outcomes": [ { "entityType": "delay_profile", "action": "create" } ], "missingReferences": [ { "fromType": "delay_profile", "toType": "delay_profile" } ], "errors": [ { "entityType": "delay_profile" } ] }, "missingReferences": [ { "fromType": "delay_profile", "toType": "delay_profile" } ]}