curl --request POST \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/packages \
--header 'Content-Type: application/json' \
--data '
{
"version": "<string>",
"metadata": {
"metadata.description": "<string>",
"metadata.tags": [
"<string>"
]
}
}
'Create a new package, publishing all draft and modified components
curl --request POST \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/packages \
--header 'Content-Type: application/json' \
--data '
{
"version": "<string>",
"metadata": {
"metadata.description": "<string>",
"metadata.tags": [
"<string>"
]
}
}
'1.0.0, 2.1.0){
"version": "1.0.0",
"metadata": {
"description": "Initial release with core UI components",
"tags": ["ui", "core"]
}
}
{
"package": {
"id": "pkg123",
"projectId": "proj123",
"version": "1.0.0",
"components": [
{
"id": "comp123",
"name": "ProductCard",
"type": "view",
"version": 1
},
{
"id": "comp124",
"name": "ArticleLayout",
"type": "layout",
"version": 1
}
],
"assets": [...],
"compiled": {...},
"dependencies": [...],
"metadata": {
"author": "user123",
"description": "Initial release with core UI components",
"tags": ["ui", "core"]
},
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z"
},
"validation": {
"componentChanges": {
"added": ["comp123"],
"updated": ["comp124", "comp125"],
"deleted": []
},
"statusChanges": {
"draft": ["comp123"],
"modified": ["comp124"],
"published": ["comp125"]
},
"versionIncrements": {
"comp123": { "from": null, "to": 1 },
"comp124": { "from": 2, "to": 3 }
}
}
}
{
"error": {
"code": "PACKAGE_VERSION_EXISTS",
"message": "Package version 1.0.0 already exists"
}
}
{
"error": {
"code": "NO_COMPONENTS_TO_PACKAGE",
"message": "Cannot create package: project contains no components. Create at least one component before creating a package."
}
}
curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/packages" \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0.0",
"metadata": {
"description": "Initial release"
}
}'