Creates a new content item using an existing template as a starting point. The new content inherits the template’s structure, ContentType, and package version.
Path Parameters
Request Body
ID of the template content to use
Display name for the new content
Description for the new content (overrides template description)
Content data that overrides template values. Merged with template content.
Tags for the new content (replaces template tags if provided)
Folder ID for organization
Example Request
{
"templateId": "cont123",
"name": "My New Article",
"description": "Custom Article. A personalized article based on the template.",
"content": {
"title": "Custom Title",
"subtitle": "My custom subtitle",
"author": "John Smith",
"components": [
{
"type": "ArticleParagraph",
"text": "This is my custom opening paragraph..."
}
]
}
}
Response
Returns the created Content object.
{
"id": "cont126",
"typeId": "ct123",
"typeVersion": 1,
"version": null,
"lastPublishedVersion": null,
"packageVersion": "1.0.0",
"name": "My New Article",
"description": "Custom Article. A personalized article based on the template.",
"status": "draft",
"isTemplate": false,
"content": {
"title": "Custom Title",
"subtitle": "My custom subtitle",
"heroImage": "asset123",
"author": "John Smith",
"publishDate": "2024-03-21",
"components": [
{
"type": "ArticleParagraph",
"text": "This is my custom opening paragraph..."
}
]
},
"compiled": "const body = () => { ... }",
"tags": ["Template", "Article"],
"metadata": {
"author": "user123",
"locale": "en-US"
},
"createdAt": "2024-03-22T10:00:00Z",
"updatedAt": "2024-03-22T10:00:00Z"
}
Content created from a template inherits the template’s typeId, typeVersion, and packageVersion. The provided content object is merged with the template’s content, allowing you to override specific fields.
Error Responses
Template Not Found
{
"error": {
"code": "TEMPLATE_NOT_FOUND",
"message": "Template content not found",
"details": {
"templateId": "cont123"
}
}
}
Not a Template
{
"error": {
"code": "NOT_A_TEMPLATE",
"message": "Content is not marked as a template",
"details": {
"contentId": "cont123"
}
}
}
Validation Failed
{
"error": {
"code": "VALIDATION_FAILED",
"message": "Merged content does not match schema",
"details": {
"errors": [...]
}
}
}
Code Examples
curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content/from-template" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "cont123",
"name": "My New Article",
"content": {
"title": "Custom Title",
"author": "John Smith"
}
}'