Skip to main content
PUT
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content-types
/
{id}
Update Content Type
curl --request PUT \
  --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/content-types/{id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "layoutComponentId": "<string>",
  "componentIdsAllowList": [
    {}
  ],
  "templateContentIds": [
    "<string>"
  ],
  "permissions": {},
  "metadata": {}
}
'

Path Parameters

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

Request Body

All fields are optional. Only provided fields will be updated.
name
string
Display name for the content type
description
string
Structured markdown description
layoutComponentId
string
ID of the layout component
componentIdsAllowList
array
Array of component IDs or component groups
templateContentIds
string[]
Array of pre-built content example IDs
permissions
object
Access control settings
metadata
object
Additional type metadata

Example Request

{
  "description": "Updated description for blog posts",
  "componentIdsAllowList": [
    {
      "id": "content",
      "name": "Content Components",
      "componentIds": ["c126", "c127"]
    },
    {
      "id": "media",
      "name": "Media Components",
      "componentIds": ["c128", "c129"]
    }
  ],
  "templateContentIds": ["cont125", "cont126"]
}
Updating a published content type changes its status to modified. The changes will not affect published content until the content type is published again.

Response

Returns the updated ContentType object.
{
  "id": "ct123",
  "name": "Article",
  "description": "Updated description for blog posts",
  "status": "modified",
  "version": 3,
  "lastPublishedVersion": 3,
  "layoutComponentId": "c123",
  "componentIdsAllowList": [
    {
      "id": "content",
      "name": "Content Components",
      "componentIds": ["c126", "c127"]
    },
    {
      "id": "media",
      "name": "Media Components",
      "componentIds": ["c128", "c129"]
    }
  ],
  "packageVersion": "1.0.0",
  "schema": { ... },
  "templateContentIds": ["cont125", "cont126"],
  "permissions": { ... },
  "metadata": { ... },
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-21T14:30:00Z"
}

Error Responses

Content Type Not Found

{
  "error": {
    "code": "NOT_FOUND",
    "message": "Content type not found"
  }
}

Invalid Component Allow List

{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "componentIdsAllowList validation failed",
    "details": {
      "duplicateGroupIds": ["questions"],
      "invalidComponentIds": ["c999"],
      "emptyGroups": ["media"],
      "missingFields": [
        {
          "groupIndex": 2,
          "missingFields": ["id"]
        }
      ]
    }
  }
}

Code Examples

curl -X PUT "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content-types/ct123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Updated description",
    "componentIdsAllowList": ["c126", "c127", "c128"]
  }'