Documentation Index
Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
Use this file to discover all available pages before exploring further.
Updates content to use a newer ContentType version, updating the derived packageVersion and validating against the new schema.
Path Parameters
Request Body
The ContentType version to migrate to
Example Request
{
"targetTypeVersion": 3
}
Response
Returns the updated Content object with the new 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"
}
Migration changes the 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 Responses
ContentType Version Not Found
{
"error": {
"code": "TYPE_VERSION_NOT_FOUND",
"message": "ContentType version 3 not found"
}
}
Validation Failed
If the content doesn’t match the new schema:
{
"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"
}
]
}
}
}
Cannot Downgrade
{
"error": {
"code": "INVALID_MIGRATION",
"message": "Cannot migrate to an older ContentType version",
"details": {
"currentVersion": 3,
"targetVersion": 2
}
}
}
Code Examples
curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123/migrate" \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"targetTypeVersion": 3
}'