Skip to main content
POST
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content
Create Content
curl --request POST \
  --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/content \
  --header 'Content-Type: application/json' \
  --data '
{
  "typeId": "<string>",
  "name": "<string>",
  "description": "<string>",
  "isTemplate": true,
  "content": {},
  "tags": [
    "<string>"
  ],
  "folderId": "<string>",
  "metadata": {
    "metadata.locale": "<string>"
  }
}
'

Path Parameters

organizationId
string
required
Organization ID
projectId
string
required
Project ID

Request Body

typeId
string
required
ID of the ContentType to use
name
string
required
Display name for the content
description
string
Structured markdown description for semantic search
isTemplate
boolean
default:"false"
Whether this content should serve as a template
content
object
required
The content data following the ContentType’s schema
tags
string[]
Tags for categorization and filtering
folderId
string
Folder ID for organization
metadata
object
Additional metadata

Example Request

{
  "typeId": "ct123",
  "name": "Getting Started Guide",
  "description": "Getting Started with Metabind. A comprehensive guide for new users.\n\n**Topics:** Technology, Platform Overview\n**Key points:** Platform basics, core features\n**Length:** ~1500 words\n**Language:** English",
  "isTemplate": false,
  "content": {
    "title": "Getting Started with Metabind",
    "subtitle": "Your journey begins here",
    "author": "Documentation Team",
    "heroImage": "asset999",
    "components": [
      {
        "type": "ArticleParagraph",
        "text": "Welcome to Metabind! This guide will help you get started..."
      },
      {
        "type": "ArticleHeading",
        "text": "First Steps",
        "level": 2
      }
    ]
  },
  "tags": ["Tutorial"],
  "metadata": {
    "locale": "en-US"
  }
}

Response

Returns the created Content object with derived fields like packageVersion from the latest ContentType version.
{
  "id": "cont125",
  "typeId": "ct123",
  "typeVersion": 2,
  "version": null,
  "lastPublishedVersion": null,
  "packageVersion": "1.0.0",
  "name": "Getting Started Guide",
  "description": "Getting Started with Metabind...",
  "status": "draft",
  "isTemplate": false,
  "content": {
    "title": "Getting Started with Metabind",
    "subtitle": "Your journey begins here",
    "author": "Documentation Team",
    "heroImage": "asset999",
    "components": [...]
  },
  "compiled": "const body = () => { ... }",
  "tags": ["Tutorial"],
  "metadata": {
    "author": "user123",
    "locale": "en-US"
  },
  "createdAt": "2024-03-21T10:00:00Z",
  "updatedAt": "2024-03-21T10:00:00Z"
}
New content is created with draft status and null version. The typeVersion and packageVersion are automatically set from the latest published ContentType version.

Error Responses

ContentType Not Found

{
  "error": {
    "code": "CONTENT_TYPE_NOT_FOUND",
    "message": "Content type not found",
    "details": {
      "typeId": "ct123"
    }
  }
}

Validation Failed

{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Content does not match schema",
    "details": {
      "errors": [
        {
          "path": "/content/title",
          "message": "Required field missing"
        }
      ]
    }
  }
}

Invalid Component

{
  "error": {
    "code": "INVALID_COMPONENT",
    "message": "Component type not allowed",
    "details": {
      "componentType": "VideoPlayer",
      "allowedTypes": ["ArticleParagraph", "ArticleHeading", "ArticleImage"]
    }
  }
}

Code Examples

curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "typeId": "ct123",
    "name": "Getting Started Guide",
    "content": {
      "title": "Getting Started with Metabind",
      "components": [
        {
          "type": "ArticleParagraph",
          "text": "Welcome to Metabind!"
        }
      ]
    }
  }'