Linkages
1. Minimal Payload Structure
The minimal payload structure for a linkage is defined by the BasicLinkage schema:
{
"meta_id": "string",
"category": "string"
}Required Fields
meta_id(string): The meta_id of the record to link to (e.g.,FE00000001,SE00000001,SH00000001)category(string): The category of the linked record (e.g., "Feature", "Show", "Season", "Episode")
2. CRUD Operations
Create
Linkages are created as part of record creation or update operations. Include the linkage array in your request payload:
Endpoint: PUT /record/{metaId} or POST /record/create
Example - Creating a Feature with linkage:
{
"original_title": "My Feature Film",
"category": "Feature",
"first_release_year": 2023,
"linkage": [
{
"meta_id": "FE00000002",
"category": "Feature"
}
]
}Example - Linking an existing Feature to another record:
Read
Retrieve linkages for a record:
Endpoint: GET /record/{metaId}
The response includes a linkage array with linked records:
Example - Get Feature linkages:
Specific Linkage Endpoints:
POST /record/linkage- Get records linkage with additional dataPOST /record/linkage/full- Get full record linkage
Example - Get linkage by category (Feature):
Update
Update linkages by including the linkage array in your update request:
Endpoint: PUT /record/{metaId}
Example - Updating Feature linkages:
The system will automatically:
Create new linkages that don't exist
Update existing linkages
Remove linkages that are not included in the array (depending on implementation)
Example - Updating a Feature record and its linkages:
Delete
Delete linkages by either:
Excluding from array: Remove the linkage from the
linkagearray in an update requestSetting deleted flag: Include
"deleted": truein the linkage object:
Example - Deleting a Feature linkage:
Example - Removing all linkages from a Feature:
Note: When a record is deleted, all its linkages are automatically removed.
3. Show Season Episode Relationship
The Show → Season → Episode relationship is a hierarchical structure where:
Show is the top-level record
Season is linked to a Show
Episode is directly linked to both a Season and a Show
The Episode's Show linkage is automatically managed based on the Episode's Season relationship
Creating the Hierarchy
Step 1: Create the Show
Resulting meta_id: SH00000001
Step 2: Create and Link a Season
Resulting meta_id: SE00000001
Step 3: Create and Link an Episode
Important: When you link an Episode to a Season, the system automatically:
Creates a direct linkage between the Episode and the Season's parent Show
The Episode now has two direct linkages: one to the Season and one to the Show
The Show linkage is automatically defined/managed based on the Season relationship
Response Structure for Show Season Episode
When retrieving a Show, Season, or Episode with linkages, the response includes:
For Show:
For Season:
For Episode:
Note: The Episode has direct linkages to both the Season and the Show. The Show linkage is automatically created and managed based on the Season's parent Show.
Key Features
Automatic Show Linkage: When an Episode is linked to a Season, the system automatically creates a direct linkage between the Episode and the Season's parent Show.
Direct Linkages: Episodes have direct linkages to both Season and Show in the database. The Show linkage is automatically managed based on the Episode's Season relationship.
Numbering:
Seasons use
season_numberfromseason_numberingEpisodes use
episode_numberfromepisode_numberingand inheritseason_numberfrom their parent Season
Episode Count: Seasons include
number_of_episodeswhich counts all linked Episodes.
Updating Show Season Episode Relationships
To change an Episode's Season:
The system will:
Detach the Episode from the old Season
Attach the Episode to the new Season
Automatically update the Episode's Show linkage to match the new Season's parent Show
To change a Season's Show:
All Episodes in the Season will automatically have their Show linkages updated to match the new Show.
Important Constraint
An Episode should only link to 1 Season.
4. FAQ
Last updated

