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

Path Parameters

organizationId
string
required
Organization ID
projectId
string
required
Project ID

Request Body

name
string
required
Display name for the content type (e.g., “Article”, “BlogPost”)
description
string
Structured markdown description for semantic search and LLM understanding
layoutComponentId
string
required
ID of the layout component that defines the structure
componentIdsAllowList
array
required
Array of component IDs or component groups that can be used within this content type
packageVersion
string
required
Version of package to use for component resolution
templateContentIds
string[]
Array of pre-built content example IDs
permissions
object
Access control settings
metadata
object
Additional type metadata

Example Request

{
  "name": "BlogPost",
  "description": "Blog post content type for personal and corporate blogging.\n\n**Content structure:**\n- Featured image and title\n- Author bio section\n- Rich text with code snippets\n\n**Best for:**\n- Personal blogs\n- Technical tutorials\n\n**Typical length:** 800-2000 words\n**Supported platforms:** Web, iOS, Android, React",
  "layoutComponentId": "c125",
  "componentIdsAllowList": ["c126", "c127", "c128"],
  "packageVersion": "1.0.0",
  "templateContentIds": ["cont125"],
  "permissions": {
    "roles": ["blogger", "editor"]
  },
  "metadata": {
    "tags": ["blog", "content"],
    "locales": ["en-US"]
  }
}
New content types are created with draft status and null version. Use the publish endpoint to create the first published version.

Response

Returns the created ContentType object.
{
  "id": "ct125",
  "name": "BlogPost",
  "description": "Blog post content type for personal and corporate blogging...",
  "status": "draft",
  "version": null,
  "lastPublishedVersion": null,
  "layoutComponentId": "c125",
  "componentIdsAllowList": ["c126", "c127", "c128"],
  "packageVersion": "1.0.0",
  "schema": { ... },
  "templateContentIds": ["cont125"],
  "permissions": {
    "roles": ["blogger", "editor"],
    "users": [],
    "publish": {
      "roles": [],
      "users": []
    }
  },
  "metadata": {
    "author": "user123",
    "tags": ["blog", "content"],
    "locales": ["en-US"]
  },
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-20T10:00:00Z"
}

Error Responses

Component Not Found

{
  "error": {
    "code": "COMPONENT_NOT_FOUND",
    "message": "Layout component not found",
    "details": {
      "componentId": "c125"
    }
  }
}

Invalid Package Version

{
  "error": {
    "code": "PACKAGE_NOT_FOUND",
    "message": "Package version 1.0.0 not found"
  }
}

Invalid Component Allow List

{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "componentIdsAllowList validation failed",
    "details": {
      "invalidComponentIds": ["c999"],
      "emptyGroups": ["media"]
    }
  }
}

Code Examples

curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content-types" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "BlogPost",
    "layoutComponentId": "c125",
    "componentIdsAllowList": ["c126", "c127"],
    "packageVersion": "1.0.0"
  }'