Articles
Create Article
Guidelines for creating multilingual articles in Octavia AI CMS.
POST
/
articles
/
create
Create article
curl --request POST \
--url https://api.octaviatech.app/cms/articles/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"mainTitle": {
"en": "Hello World",
"es": "Hola Mundo"
},
"title2": {
"en": "Subheadline",
"es": "Subtítulo"
},
"title3": {
"en": "Additional Section Title",
"es": "Título de Sección Adicional"
},
"slug": "hello-world",
"summary": {
"en": "Short summary of the article for readers.",
"es": "Breve resumen del artículo para los lectores."
},
"body": {
"en": "<p>This is the main HTML body of the article.</p>",
"es": "<p>Este es el cuerpo principal en HTML del artículo.</p>"
},
"thumbnail": "https://cdn.example.com/img.jpg",
"banner": "https://cdn.example.com/banner.jpg",
"tags": [
"news",
"ai"
],
"category": [
"64b1f2c9a7d4f1a2b3c4d5e6"
],
"subCategory": [
"64b1f2c9a7d4f1a2b3c4d5e7"
],
"author": "64b1f2c9a7d4f1a2b3c4d5e8",
"language": "en",
"gallery": [
"https://cdn.example.com/g1.jpg",
"https://cdn.example.com/g2.jpg"
],
"publishDate": "2025-10-01T12:00:00Z",
"isPublished": true,
"isPrivate": false,
"autoSummarize": false
}
'import requests
url = "https://api.octaviatech.app/cms/articles/create"
payload = {
"mainTitle": {
"en": "Hello World",
"es": "Hola Mundo"
},
"title2": {
"en": "Subheadline",
"es": "Subtítulo"
},
"title3": {
"en": "Additional Section Title",
"es": "Título de Sección Adicional"
},
"slug": "hello-world",
"summary": {
"en": "Short summary of the article for readers.",
"es": "Breve resumen del artículo para los lectores."
},
"body": {
"en": "<p>This is the main HTML body of the article.</p>",
"es": "<p>Este es el cuerpo principal en HTML del artículo.</p>"
},
"thumbnail": "https://cdn.example.com/img.jpg",
"banner": "https://cdn.example.com/banner.jpg",
"tags": ["news", "ai"],
"category": ["64b1f2c9a7d4f1a2b3c4d5e6"],
"subCategory": ["64b1f2c9a7d4f1a2b3c4d5e7"],
"author": "64b1f2c9a7d4f1a2b3c4d5e8",
"language": "en",
"gallery": ["https://cdn.example.com/g1.jpg", "https://cdn.example.com/g2.jpg"],
"publishDate": "2025-10-01T12:00:00Z",
"isPublished": True,
"isPrivate": False,
"autoSummarize": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mainTitle: {en: 'Hello World', es: 'Hola Mundo'},
title2: {en: 'Subheadline', es: 'Subtítulo'},
title3: {en: 'Additional Section Title', es: 'Título de Sección Adicional'},
slug: 'hello-world',
summary: {
en: 'Short summary of the article for readers.',
es: 'Breve resumen del artículo para los lectores.'
},
body: JSON.stringify({
en: '<p>This is the main HTML body of the article.</p>',
es: '<p>Este es el cuerpo principal en HTML del artículo.</p>'
}),
thumbnail: 'https://cdn.example.com/img.jpg',
banner: 'https://cdn.example.com/banner.jpg',
tags: ['news', 'ai'],
category: ['64b1f2c9a7d4f1a2b3c4d5e6'],
subCategory: ['64b1f2c9a7d4f1a2b3c4d5e7'],
author: '64b1f2c9a7d4f1a2b3c4d5e8',
language: 'en',
gallery: ['https://cdn.example.com/g1.jpg', 'https://cdn.example.com/g2.jpg'],
publishDate: '2025-10-01T12:00:00Z',
isPublished: true,
isPrivate: false,
autoSummarize: false
})
};
fetch('https://api.octaviatech.app/cms/articles/create', 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.octaviatech.app/cms/articles/create",
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([
'mainTitle' => [
'en' => 'Hello World',
'es' => 'Hola Mundo'
],
'title2' => [
'en' => 'Subheadline',
'es' => 'Subtítulo'
],
'title3' => [
'en' => 'Additional Section Title',
'es' => 'Título de Sección Adicional'
],
'slug' => 'hello-world',
'summary' => [
'en' => 'Short summary of the article for readers.',
'es' => 'Breve resumen del artículo para los lectores.'
],
'body' => [
'en' => '<p>This is the main HTML body of the article.</p>',
'es' => '<p>Este es el cuerpo principal en HTML del artículo.</p>'
],
'thumbnail' => 'https://cdn.example.com/img.jpg',
'banner' => 'https://cdn.example.com/banner.jpg',
'tags' => [
'news',
'ai'
],
'category' => [
'64b1f2c9a7d4f1a2b3c4d5e6'
],
'subCategory' => [
'64b1f2c9a7d4f1a2b3c4d5e7'
],
'author' => '64b1f2c9a7d4f1a2b3c4d5e8',
'language' => 'en',
'gallery' => [
'https://cdn.example.com/g1.jpg',
'https://cdn.example.com/g2.jpg'
],
'publishDate' => '2025-10-01T12:00:00Z',
'isPublished' => true,
'isPrivate' => false,
'autoSummarize' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.octaviatech.app/cms/articles/create"
payload := strings.NewReader("{\n \"mainTitle\": {\n \"en\": \"Hello World\",\n \"es\": \"Hola Mundo\"\n },\n \"title2\": {\n \"en\": \"Subheadline\",\n \"es\": \"Subtítulo\"\n },\n \"title3\": {\n \"en\": \"Additional Section Title\",\n \"es\": \"Título de Sección Adicional\"\n },\n \"slug\": \"hello-world\",\n \"summary\": {\n \"en\": \"Short summary of the article for readers.\",\n \"es\": \"Breve resumen del artículo para los lectores.\"\n },\n \"body\": {\n \"en\": \"<p>This is the main HTML body of the article.</p>\",\n \"es\": \"<p>Este es el cuerpo principal en HTML del artículo.</p>\"\n },\n \"thumbnail\": \"https://cdn.example.com/img.jpg\",\n \"banner\": \"https://cdn.example.com/banner.jpg\",\n \"tags\": [\n \"news\",\n \"ai\"\n ],\n \"category\": [\n \"64b1f2c9a7d4f1a2b3c4d5e6\"\n ],\n \"subCategory\": [\n \"64b1f2c9a7d4f1a2b3c4d5e7\"\n ],\n \"author\": \"64b1f2c9a7d4f1a2b3c4d5e8\",\n \"language\": \"en\",\n \"gallery\": [\n \"https://cdn.example.com/g1.jpg\",\n \"https://cdn.example.com/g2.jpg\"\n ],\n \"publishDate\": \"2025-10-01T12:00:00Z\",\n \"isPublished\": true,\n \"isPrivate\": false,\n \"autoSummarize\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.octaviatech.app/cms/articles/create")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mainTitle\": {\n \"en\": \"Hello World\",\n \"es\": \"Hola Mundo\"\n },\n \"title2\": {\n \"en\": \"Subheadline\",\n \"es\": \"Subtítulo\"\n },\n \"title3\": {\n \"en\": \"Additional Section Title\",\n \"es\": \"Título de Sección Adicional\"\n },\n \"slug\": \"hello-world\",\n \"summary\": {\n \"en\": \"Short summary of the article for readers.\",\n \"es\": \"Breve resumen del artículo para los lectores.\"\n },\n \"body\": {\n \"en\": \"<p>This is the main HTML body of the article.</p>\",\n \"es\": \"<p>Este es el cuerpo principal en HTML del artículo.</p>\"\n },\n \"thumbnail\": \"https://cdn.example.com/img.jpg\",\n \"banner\": \"https://cdn.example.com/banner.jpg\",\n \"tags\": [\n \"news\",\n \"ai\"\n ],\n \"category\": [\n \"64b1f2c9a7d4f1a2b3c4d5e6\"\n ],\n \"subCategory\": [\n \"64b1f2c9a7d4f1a2b3c4d5e7\"\n ],\n \"author\": \"64b1f2c9a7d4f1a2b3c4d5e8\",\n \"language\": \"en\",\n \"gallery\": [\n \"https://cdn.example.com/g1.jpg\",\n \"https://cdn.example.com/g2.jpg\"\n ],\n \"publishDate\": \"2025-10-01T12:00:00Z\",\n \"isPublished\": true,\n \"isPrivate\": false,\n \"autoSummarize\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octaviatech.app/cms/articles/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mainTitle\": {\n \"en\": \"Hello World\",\n \"es\": \"Hola Mundo\"\n },\n \"title2\": {\n \"en\": \"Subheadline\",\n \"es\": \"Subtítulo\"\n },\n \"title3\": {\n \"en\": \"Additional Section Title\",\n \"es\": \"Título de Sección Adicional\"\n },\n \"slug\": \"hello-world\",\n \"summary\": {\n \"en\": \"Short summary of the article for readers.\",\n \"es\": \"Breve resumen del artículo para los lectores.\"\n },\n \"body\": {\n \"en\": \"<p>This is the main HTML body of the article.</p>\",\n \"es\": \"<p>Este es el cuerpo principal en HTML del artículo.</p>\"\n },\n \"thumbnail\": \"https://cdn.example.com/img.jpg\",\n \"banner\": \"https://cdn.example.com/banner.jpg\",\n \"tags\": [\n \"news\",\n \"ai\"\n ],\n \"category\": [\n \"64b1f2c9a7d4f1a2b3c4d5e6\"\n ],\n \"subCategory\": [\n \"64b1f2c9a7d4f1a2b3c4d5e7\"\n ],\n \"author\": \"64b1f2c9a7d4f1a2b3c4d5e8\",\n \"language\": \"en\",\n \"gallery\": [\n \"https://cdn.example.com/g1.jpg\",\n \"https://cdn.example.com/g2.jpg\"\n ],\n \"publishDate\": \"2025-10-01T12:00:00Z\",\n \"isPublished\": true,\n \"isPrivate\": false,\n \"autoSummarize\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 201,
"message": "Created",
"data": {
"id": "{{objectId}}",
"slug": "hello-world"
}
}{
"success": false,
"statusCode": 401,
"message": "Unauthorized",
"data": null
}{
"success": false,
"statusCode": 403,
"message": "Forbidden",
"data": null
}{
"success": false,
"statusCode": 409,
"message": "Slug already exists",
"data": null
}{
"success": false,
"statusCode": 422,
"message": "Validation failed",
"data": null
}{
"success": false,
"statusCode": 500,
"message": "Internal server error",
"data": null
}When creating an article in Octavia AI CMS, you can include content in multiple languages.
Fields that support localization must be sent in the standard multilingual format, where each language is represented by a lowercase ISO 639-1 code (for example,
Fields that support localization must be sent in the standard multilingual format, where each language is represented by a lowercase ISO 639-1 code (for example,
en, es, fr).
Example format:
"mainTitle": {
"en": "Building modern content workflows with Octavia AI CMS",
"es": "Creación de flujos de contenido modernos con Octavia AI CMS",
...
}
Rules
- ✅ Keys must be lowercase ISO 639-1 codes (
en,es,de, etc.) - ✅ At least one language (your default) is required
- ✅ Values must be plain strings (HTML allowed for
content) - ❌ Do not send a single string for multilingual fields
- ❌ Do not use uppercase or non-standard codes (e.g.,
EN,eng)
Validation & Behavior
- Slug must be unique within your workspace
- Publish controls:
isPublished,isPrivate, andpublishDateare optional - Language fallback: if the requested
langdoesn’t exist, the API returns the default language - Content field supports only HTML, not Markdown
- Category, subCategory, and author fields expect valid IDs
- When using the
langheader, localized fields are flattened to a single string; otherwise, the full language map is returned
Authorizations
Body
application/json
Main title in multiple languages
Show child attributes
Show child attributes
Main article content (HTML allowed)
Show child attributes
Show child attributes
Array of category IDs
Pattern:
^[a-fA-F0-9]{24}$Author ID
Pattern:
^[a-fA-F0-9]{24}$Optional secondary title in multiple languages
Show child attributes
Show child attributes
Optional tertiary title in multiple languages
Show child attributes
Show child attributes
URL-friendly unique identifier
Short summary in multiple languages
Show child attributes
Show child attributes
Thumbnail image URL
Banner image URL
List of tags
Array of sub-category IDs
Pattern:
^[a-fA-F0-9]{24}$Optional gallery image URLs
Publish date in ISO 8601
Publish state
If true, restricts visibility
Preferred language for immediate rendering/preview
Available options:
en, es If true, backend may auto-create a summary
Response
Created
Was this page helpful?
⌘I
Create article
curl --request POST \
--url https://api.octaviatech.app/cms/articles/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"mainTitle": {
"en": "Hello World",
"es": "Hola Mundo"
},
"title2": {
"en": "Subheadline",
"es": "Subtítulo"
},
"title3": {
"en": "Additional Section Title",
"es": "Título de Sección Adicional"
},
"slug": "hello-world",
"summary": {
"en": "Short summary of the article for readers.",
"es": "Breve resumen del artículo para los lectores."
},
"body": {
"en": "<p>This is the main HTML body of the article.</p>",
"es": "<p>Este es el cuerpo principal en HTML del artículo.</p>"
},
"thumbnail": "https://cdn.example.com/img.jpg",
"banner": "https://cdn.example.com/banner.jpg",
"tags": [
"news",
"ai"
],
"category": [
"64b1f2c9a7d4f1a2b3c4d5e6"
],
"subCategory": [
"64b1f2c9a7d4f1a2b3c4d5e7"
],
"author": "64b1f2c9a7d4f1a2b3c4d5e8",
"language": "en",
"gallery": [
"https://cdn.example.com/g1.jpg",
"https://cdn.example.com/g2.jpg"
],
"publishDate": "2025-10-01T12:00:00Z",
"isPublished": true,
"isPrivate": false,
"autoSummarize": false
}
'import requests
url = "https://api.octaviatech.app/cms/articles/create"
payload = {
"mainTitle": {
"en": "Hello World",
"es": "Hola Mundo"
},
"title2": {
"en": "Subheadline",
"es": "Subtítulo"
},
"title3": {
"en": "Additional Section Title",
"es": "Título de Sección Adicional"
},
"slug": "hello-world",
"summary": {
"en": "Short summary of the article for readers.",
"es": "Breve resumen del artículo para los lectores."
},
"body": {
"en": "<p>This is the main HTML body of the article.</p>",
"es": "<p>Este es el cuerpo principal en HTML del artículo.</p>"
},
"thumbnail": "https://cdn.example.com/img.jpg",
"banner": "https://cdn.example.com/banner.jpg",
"tags": ["news", "ai"],
"category": ["64b1f2c9a7d4f1a2b3c4d5e6"],
"subCategory": ["64b1f2c9a7d4f1a2b3c4d5e7"],
"author": "64b1f2c9a7d4f1a2b3c4d5e8",
"language": "en",
"gallery": ["https://cdn.example.com/g1.jpg", "https://cdn.example.com/g2.jpg"],
"publishDate": "2025-10-01T12:00:00Z",
"isPublished": True,
"isPrivate": False,
"autoSummarize": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mainTitle: {en: 'Hello World', es: 'Hola Mundo'},
title2: {en: 'Subheadline', es: 'Subtítulo'},
title3: {en: 'Additional Section Title', es: 'Título de Sección Adicional'},
slug: 'hello-world',
summary: {
en: 'Short summary of the article for readers.',
es: 'Breve resumen del artículo para los lectores.'
},
body: JSON.stringify({
en: '<p>This is the main HTML body of the article.</p>',
es: '<p>Este es el cuerpo principal en HTML del artículo.</p>'
}),
thumbnail: 'https://cdn.example.com/img.jpg',
banner: 'https://cdn.example.com/banner.jpg',
tags: ['news', 'ai'],
category: ['64b1f2c9a7d4f1a2b3c4d5e6'],
subCategory: ['64b1f2c9a7d4f1a2b3c4d5e7'],
author: '64b1f2c9a7d4f1a2b3c4d5e8',
language: 'en',
gallery: ['https://cdn.example.com/g1.jpg', 'https://cdn.example.com/g2.jpg'],
publishDate: '2025-10-01T12:00:00Z',
isPublished: true,
isPrivate: false,
autoSummarize: false
})
};
fetch('https://api.octaviatech.app/cms/articles/create', 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.octaviatech.app/cms/articles/create",
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([
'mainTitle' => [
'en' => 'Hello World',
'es' => 'Hola Mundo'
],
'title2' => [
'en' => 'Subheadline',
'es' => 'Subtítulo'
],
'title3' => [
'en' => 'Additional Section Title',
'es' => 'Título de Sección Adicional'
],
'slug' => 'hello-world',
'summary' => [
'en' => 'Short summary of the article for readers.',
'es' => 'Breve resumen del artículo para los lectores.'
],
'body' => [
'en' => '<p>This is the main HTML body of the article.</p>',
'es' => '<p>Este es el cuerpo principal en HTML del artículo.</p>'
],
'thumbnail' => 'https://cdn.example.com/img.jpg',
'banner' => 'https://cdn.example.com/banner.jpg',
'tags' => [
'news',
'ai'
],
'category' => [
'64b1f2c9a7d4f1a2b3c4d5e6'
],
'subCategory' => [
'64b1f2c9a7d4f1a2b3c4d5e7'
],
'author' => '64b1f2c9a7d4f1a2b3c4d5e8',
'language' => 'en',
'gallery' => [
'https://cdn.example.com/g1.jpg',
'https://cdn.example.com/g2.jpg'
],
'publishDate' => '2025-10-01T12:00:00Z',
'isPublished' => true,
'isPrivate' => false,
'autoSummarize' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.octaviatech.app/cms/articles/create"
payload := strings.NewReader("{\n \"mainTitle\": {\n \"en\": \"Hello World\",\n \"es\": \"Hola Mundo\"\n },\n \"title2\": {\n \"en\": \"Subheadline\",\n \"es\": \"Subtítulo\"\n },\n \"title3\": {\n \"en\": \"Additional Section Title\",\n \"es\": \"Título de Sección Adicional\"\n },\n \"slug\": \"hello-world\",\n \"summary\": {\n \"en\": \"Short summary of the article for readers.\",\n \"es\": \"Breve resumen del artículo para los lectores.\"\n },\n \"body\": {\n \"en\": \"<p>This is the main HTML body of the article.</p>\",\n \"es\": \"<p>Este es el cuerpo principal en HTML del artículo.</p>\"\n },\n \"thumbnail\": \"https://cdn.example.com/img.jpg\",\n \"banner\": \"https://cdn.example.com/banner.jpg\",\n \"tags\": [\n \"news\",\n \"ai\"\n ],\n \"category\": [\n \"64b1f2c9a7d4f1a2b3c4d5e6\"\n ],\n \"subCategory\": [\n \"64b1f2c9a7d4f1a2b3c4d5e7\"\n ],\n \"author\": \"64b1f2c9a7d4f1a2b3c4d5e8\",\n \"language\": \"en\",\n \"gallery\": [\n \"https://cdn.example.com/g1.jpg\",\n \"https://cdn.example.com/g2.jpg\"\n ],\n \"publishDate\": \"2025-10-01T12:00:00Z\",\n \"isPublished\": true,\n \"isPrivate\": false,\n \"autoSummarize\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.octaviatech.app/cms/articles/create")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mainTitle\": {\n \"en\": \"Hello World\",\n \"es\": \"Hola Mundo\"\n },\n \"title2\": {\n \"en\": \"Subheadline\",\n \"es\": \"Subtítulo\"\n },\n \"title3\": {\n \"en\": \"Additional Section Title\",\n \"es\": \"Título de Sección Adicional\"\n },\n \"slug\": \"hello-world\",\n \"summary\": {\n \"en\": \"Short summary of the article for readers.\",\n \"es\": \"Breve resumen del artículo para los lectores.\"\n },\n \"body\": {\n \"en\": \"<p>This is the main HTML body of the article.</p>\",\n \"es\": \"<p>Este es el cuerpo principal en HTML del artículo.</p>\"\n },\n \"thumbnail\": \"https://cdn.example.com/img.jpg\",\n \"banner\": \"https://cdn.example.com/banner.jpg\",\n \"tags\": [\n \"news\",\n \"ai\"\n ],\n \"category\": [\n \"64b1f2c9a7d4f1a2b3c4d5e6\"\n ],\n \"subCategory\": [\n \"64b1f2c9a7d4f1a2b3c4d5e7\"\n ],\n \"author\": \"64b1f2c9a7d4f1a2b3c4d5e8\",\n \"language\": \"en\",\n \"gallery\": [\n \"https://cdn.example.com/g1.jpg\",\n \"https://cdn.example.com/g2.jpg\"\n ],\n \"publishDate\": \"2025-10-01T12:00:00Z\",\n \"isPublished\": true,\n \"isPrivate\": false,\n \"autoSummarize\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octaviatech.app/cms/articles/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mainTitle\": {\n \"en\": \"Hello World\",\n \"es\": \"Hola Mundo\"\n },\n \"title2\": {\n \"en\": \"Subheadline\",\n \"es\": \"Subtítulo\"\n },\n \"title3\": {\n \"en\": \"Additional Section Title\",\n \"es\": \"Título de Sección Adicional\"\n },\n \"slug\": \"hello-world\",\n \"summary\": {\n \"en\": \"Short summary of the article for readers.\",\n \"es\": \"Breve resumen del artículo para los lectores.\"\n },\n \"body\": {\n \"en\": \"<p>This is the main HTML body of the article.</p>\",\n \"es\": \"<p>Este es el cuerpo principal en HTML del artículo.</p>\"\n },\n \"thumbnail\": \"https://cdn.example.com/img.jpg\",\n \"banner\": \"https://cdn.example.com/banner.jpg\",\n \"tags\": [\n \"news\",\n \"ai\"\n ],\n \"category\": [\n \"64b1f2c9a7d4f1a2b3c4d5e6\"\n ],\n \"subCategory\": [\n \"64b1f2c9a7d4f1a2b3c4d5e7\"\n ],\n \"author\": \"64b1f2c9a7d4f1a2b3c4d5e8\",\n \"language\": \"en\",\n \"gallery\": [\n \"https://cdn.example.com/g1.jpg\",\n \"https://cdn.example.com/g2.jpg\"\n ],\n \"publishDate\": \"2025-10-01T12:00:00Z\",\n \"isPublished\": true,\n \"isPrivate\": false,\n \"autoSummarize\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 201,
"message": "Created",
"data": {
"id": "{{objectId}}",
"slug": "hello-world"
}
}{
"success": false,
"statusCode": 401,
"message": "Unauthorized",
"data": null
}{
"success": false,
"statusCode": 403,
"message": "Forbidden",
"data": null
}{
"success": false,
"statusCode": 409,
"message": "Slug already exists",
"data": null
}{
"success": false,
"statusCode": 422,
"message": "Validation failed",
"data": null
}{
"success": false,
"statusCode": 500,
"message": "Internal server error",
"data": null
}
