Create Content
curl --request POST \
--url https://api.example.com/app/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>"
}
}
'import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content"
payload = {
"typeId": "<string>",
"name": "<string>",
"description": "<string>",
"isTemplate": True,
"content": {},
"tags": ["<string>"],
"folderId": "<string>",
"metadata": { "metadata.locale": "<string>" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
typeId: '<string>',
name: '<string>',
description: '<string>',
isTemplate: true,
content: {},
tags: ['<string>'],
folderId: '<string>',
metadata: {'metadata.locale': '<string>'}
})
};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'typeId' => '<string>',
'name' => '<string>',
'description' => '<string>',
'isTemplate' => true,
'content' => [
],
'tags' => [
'<string>'
],
'folderId' => '<string>',
'metadata' => [
'metadata.locale' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content"
payload := strings.NewReader("{\n \"typeId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"content\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"folderId\": \"<string>\",\n \"metadata\": {\n \"metadata.locale\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content")
.header("Content-Type", "application/json")
.body("{\n \"typeId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"content\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"folderId\": \"<string>\",\n \"metadata\": {\n \"metadata.locale\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"typeId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"content\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"folderId\": \"<string>\",\n \"metadata\": {\n \"metadata.locale\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyContent
Create Content
Create a new content item
POST
/
app
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content
Create Content
curl --request POST \
--url https://api.example.com/app/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>"
}
}
'import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content"
payload = {
"typeId": "<string>",
"name": "<string>",
"description": "<string>",
"isTemplate": True,
"content": {},
"tags": ["<string>"],
"folderId": "<string>",
"metadata": { "metadata.locale": "<string>" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
typeId: '<string>',
name: '<string>',
description: '<string>',
isTemplate: true,
content: {},
tags: ['<string>'],
folderId: '<string>',
metadata: {'metadata.locale': '<string>'}
})
};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'typeId' => '<string>',
'name' => '<string>',
'description' => '<string>',
'isTemplate' => true,
'content' => [
],
'tags' => [
'<string>'
],
'folderId' => '<string>',
'metadata' => [
'metadata.locale' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content"
payload := strings.NewReader("{\n \"typeId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"content\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"folderId\": \"<string>\",\n \"metadata\": {\n \"metadata.locale\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content")
.header("Content-Type", "application/json")
.body("{\n \"typeId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"content\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"folderId\": \"<string>\",\n \"metadata\": {\n \"metadata.locale\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"typeId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"content\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"folderId\": \"<string>\",\n \"metadata\": {\n \"metadata.locale\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyPath Parameters
string
required
Organization ID
string
required
Project ID
Request Body
string
required
ID of the ContentType to use
string
required
Display name for the content
string
Structured markdown description for semantic search
boolean
default:"false"
Whether this content should serve as a template
object
required
The content data following the ContentType’s schema
string[]
Tags for categorization and filtering
string
Folder ID for organization
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 likepackageVersion 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/app/v1/organizations/org123/projects/proj456/content" \
-H "Authorization: Bearer YOUR_JWT" \
-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!"
}
]
}
}'
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_JWT',
'Content-Type': 'application/json'
},
body: JSON.stringify({
typeId: 'ct123',
name: 'Getting Started Guide',
content: {
title: 'Getting Started with Metabind',
components: [
{
type: 'ArticleParagraph',
text: 'Welcome to Metabind!'
}
]
}
})
}
);
const content = await response.json();
console.log(`Created content: ${content.id}`);