Skip to main content
POST
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content-types
/
{id}
/
publish
Publish Content Type
curl --request POST \
  --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/content-types/{id}/publish
Publishing a content type creates a new immutable version. This version becomes the active definition for creating new content of this type.

Path Parameters

organizationId
string
required
Organization ID
projectId
string
required
Project ID
id
string
required
Content Type ID

Response

Returns the published ContentType object with the new version number.
{
  "id": "ct123",
  "name": "Article",
  "description": "Standard article content type...",
  "status": "published",
  "version": 4,
  "lastPublishedVersion": 4,
  "layoutComponentId": "c123",
  "componentIdsAllowList": ["c124", "c125", "c126"],
  "packageVersion": "1.0.0",
  "schema": { ... },
  "templateContentIds": ["cont123"],
  "permissions": { ... },
  "metadata": {
    "author": "[email protected]",
    "tags": ["article"],
    "publishedAt": "2024-03-22T10:00:00Z",
    "publishedBy": "user123"
  },
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-22T10:00:00Z"
}

Status Transitions

Current StatusAfter Publish
draftpublished (version 1)
modifiedpublished (version incremented)
unpublishedpublished (version incremented)
Cannot publish a content type with deleted status. Restore it first by updating the status.

Error Responses

Invalid Status

{
  "error": {
    "code": "INVALID_STATUS",
    "message": "Cannot publish content type with status: deleted"
  }
}

Invalid Components

{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Content type references components not in the specified package version",
    "details": {
      "invalidComponentIds": ["c999"]
    }
  }
}

Code Examples

curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content-types/ct123/publish" \
  -H "Authorization: Bearer YOUR_API_KEY"