Skip to content

Import a portable entity

POST
/pcd/import
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.

Media typeapplication/json
object
databaseId
required

The PCD database ID to import into

integer
layer
required

The operation layer to write to

string
Allowed values: user base
entityType
required

Portable PCD entity identifiers used by import/export endpoints.

Lidarr media-management entities are first-class portable contract members:

  • lidarr_naming
  • lidarr_media_settings
  • lidarr_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.

string
Allowed values: delay_profile regular_expression custom_format quality_profile radarr_naming sonarr_naming radarr_media_settings sonarr_media_settings radarr_quality_definitions sonarr_quality_definitions lidarr_metadata_profile lidarr_naming lidarr_media_settings lidarr_quality_definitions
migration

Optional migration metadata for hybrid imports. If provided, this field must include all keys from PortableMigrationMetadata.

object
format
required

Migration payload format marker (json for JSON payloads, yaml for YAML in future hybrid ingestion flows).

string
Allowed values: json yaml
version
required

Migration schema contract version for hybrid payloads.

integer
>= 1
source
required

Migration source marker (example: pcd-export, pcd-file, pcd-importer).

string
data
required
One of:
object
name
required
string
preferredProtocol
required
string
Allowed values: prefer_usenet prefer_torrent only_usenet only_torrent
usenetDelay
required
integer
torrentDelay
required
integer
bypassIfHighestQuality
required
boolean
bypassIfAboveCfScore
required
boolean
minimumCfScore
required
integer

Entity created successfully

Media typeapplication/json
object
success
required
boolean
Examplegenerated
{
"success": true
}

Validation error (missing fields, duplicate name, invalid data)

Media typeapplication/json
object
error
required
string
Examplegenerated
{
"error": "example"
}

Cannot write to base layer

Media typeapplication/json
object
error
required
string
Examplegenerated
{
"error": "example"
}

Database cache not available

Media typeapplication/json
object
error
required
string
Examplegenerated
{
"error": "example"
}