Create an article (always a draft)
const url = 'https://api.motenya.app/v1/knowledge-bases/example/articles';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"language":"en","categoryId":"example","slug":"getting-started","title":"example","excerpt":"example","bodyMarkdown":"example","seoTitle":"example","seoDescription":"example","tags":["example"],"position":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.motenya.app/v1/knowledge-bases/example/articles \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "language": "en", "categoryId": "example", "slug": "getting-started", "title": "example", "excerpt": "example", "bodyMarkdown": "example", "seoTitle": "example", "seoDescription": "example", "tags": [ "example" ], "position": 1 }'Requires articles:write. Publish it with POST /articles/{id}/publish.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
A language code enabled on the knowledge base, e.g. ‘en’ or ‘ro’.
Example
enCategory in the same KB and language; null for none.
Lowercase letters, digits and single hyphens; unique per knowledge base and language.
Example
getting-startedGitHub-flavoured Markdown. A single newline is a line break. Link to another article with [text](article:<articleId>), not its URL — it is resolved to the current URL in the reader’s language.
Responses
Section titled “Responses”Created
object
object
Example
{ "status": "draft"}Invalid request
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing, invalid, revoked or expired API key
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing scope, API turned off, published article without publish scope, or account suspended
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Not found, or outside the knowledge bases this key may use
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Slug or translation already exists
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Rejected by validation (e.g. unknown language or category)
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Rate limited; see Retry-After
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Internal error