curl --request POST \
--url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/migrate \
--header 'Content-Type: application/json' \
--data '
{
"targetTypeVersion": 123
}
'Migrate content to a new ContentType version
curl --request POST \
--url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/migrate \
--header 'Content-Type: application/json' \
--data '
{
"targetTypeVersion": 123
}
'packageVersion and validating against the new schema.
{
"targetTypeVersion": 3
}
typeVersion and derived packageVersion.
{
"id": "cont123",
"typeId": "ct123",
"typeVersion": 3,
"version": 2,
"lastPublishedVersion": 2,
"packageVersion": "2.0.0",
"name": "Getting Started Guide",
"status": "modified",
"isTemplate": false,
"content": { ... },
"compiled": "const body = () => { ... }",
"tags": ["Tutorial"],
"metadata": { ... },
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-23T10:00:00Z"
}
typeVersion and packageVersion. The content’s status changes to modified and must be published to make the migration live. Ensure the content is compatible with the new schema before publishing.{
"error": {
"code": "TYPE_VERSION_NOT_FOUND",
"message": "ContentType version 3 not found"
}
}
{
"error": {
"code": "VALIDATION_FAILED",
"message": "Content does not match target ContentType schema",
"details": {
"errors": [
{
"path": "/content/components/0/type",
"message": "Component type 'OldComponent' not allowed in version 3"
}
]
}
}
}
{
"error": {
"code": "INVALID_MIGRATION",
"message": "Cannot migrate to an older ContentType version",
"details": {
"currentVersion": 3,
"targetVersion": 2
}
}
}
curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content/cont123/migrate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"targetTypeVersion": 3
}'