curl --request POST \
--url https://{your-subdomain}.neetokb.com/api/external/v2/articles \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"article": {
"title": "Getting Started",
"slug": "getting-started",
"html_content": "<h1>Welcome</h1><p>Example content</p>",
"state": "draft",
"page_title": "Getting Started",
"meta_description": "A comprehensive guide to help you get started with our platform",
"category": [
"Installation",
"Getting Started"
]
}
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
article: {
title: 'Getting Started',
slug: 'getting-started',
html_content: '<h1>Welcome</h1><p>Example content</p>',
state: 'draft',
page_title: 'Getting Started',
meta_description: 'A comprehensive guide to help you get started with our platform',
category: ['Installation', 'Getting Started']
}
})
};
fetch('https://{your-subdomain}.neetokb.com/api/external/v2/articles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetokb.com/api/external/v2/articles"
payload = { "article": {
"title": "Getting Started",
"slug": "getting-started",
"html_content": "<h1>Welcome</h1><p>Example content</p>",
"state": "draft",
"page_title": "Getting Started",
"meta_description": "A comprehensive guide to help you get started with our platform",
"category": ["Installation", "Getting Started"]
} }
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"article": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"permalink": "<string>",
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"is_private": true,
"path": [
"<string>"
]
}
}
}Create article
This API allows to create a new article. For CLI sessions, creating a draft needs the Modify articles permission. Creating an article with state: published also needs the Manage articles permission.
curl --request POST \
--url https://{your-subdomain}.neetokb.com/api/external/v2/articles \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"article": {
"title": "Getting Started",
"slug": "getting-started",
"html_content": "<h1>Welcome</h1><p>Example content</p>",
"state": "draft",
"page_title": "Getting Started",
"meta_description": "A comprehensive guide to help you get started with our platform",
"category": [
"Installation",
"Getting Started"
]
}
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
article: {
title: 'Getting Started',
slug: 'getting-started',
html_content: '<h1>Welcome</h1><p>Example content</p>',
state: 'draft',
page_title: 'Getting Started',
meta_description: 'A comprehensive guide to help you get started with our platform',
category: ['Installation', 'Getting Started']
}
})
};
fetch('https://{your-subdomain}.neetokb.com/api/external/v2/articles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetokb.com/api/external/v2/articles"
payload = { "article": {
"title": "Getting Started",
"slug": "getting-started",
"html_content": "<h1>Welcome</h1><p>Example content</p>",
"state": "draft",
"page_title": "Getting Started",
"meta_description": "A comprehensive guide to help you get started with our platform",
"category": ["Installation", "Getting Started"]
} }
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"article": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"permalink": "<string>",
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"is_private": true,
"path": [
"<string>"
]
}
}
}{your-subdomain} with your workspace’s subdomain. Learn how to find your subdomain in Workspace subdomain.
Headers
Use the X-Api-Key header to provide your workspace API key. Refer to Authentication for more information.
Body
Hide child attributes
Hide child attributes
Title of the article.
"Getting Started"
URL-friendly version of the article's title.
"getting-started"
Content of the article in HTML format.
"<h1>Welcome</h1><p>Example content</p>"
Status of the article.
draft, published "draft"
Provide the article's category path as an array of category names (not IDs or slugs). List the categories from the most specific to the top-level category. The article will be placed in the first category, and each subsequent category is treated as its parent.
["Installation", "Getting Started"]
Response
Created - Article created successfully
Hide child attributes
Hide child attributes