Skip to content

Create an article (always a draft)

POST
/knowledge-bases/{kbId}/articles
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.

kbId
required
string
>= 1 characters <= 64 characters
Media typeapplication/json
object
language
required

A language code enabled on the knowledge base, e.g. ‘en’ or ‘ro’.

string
>= 2 characters <= 16 characters

Example

en
categoryId

Category in the same KB and language; null for none.

string | null
>= 1 characters <= 64 characters
slug
required

Lowercase letters, digits and single hyphens; unique per knowledge base and language.

string
<= 120 characters /^[a-z0-9]+(?:-[a-z0-9]+)*$/

Example

getting-started
title
required
string
>= 1 characters <= 200 characters
excerpt
string | null
<= 500 characters
bodyMarkdown
required

GitHub-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.

string
<= 500000 characters
seoTitle
string | null
<= 200 characters
seoDescription
string | null
<= 500 characters
tags
Array<string>
<= 30 items
position
integer
<= 100000

Created

Media typeapplication/json
object
id
required
string
>= 1 characters <= 64 characters
kbId
required
string
>= 1 characters <= 64 characters
language
required
string
categoryId
required
string | null
>= 1 characters <= 64 characters
slug
required
string
title
required
string
excerpt
required
string | null
tags
required
Array<string>
status
required
string
Allowed values: draft published archived
translationGroupId
required
string | null
publishedAt
required
string | null
updatedAt
required
string
bodyMarkdown
required
string
seoTitle
required
string | null
seoDescription
required
string | null
translations
required
Array<object>
object
language
required
string
slug
required
string

Example

{
"status": "draft"
}

Invalid request

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Missing, invalid, revoked or expired API key

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Missing scope, API turned off, published article without publish scope, or account suspended

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Not found, or outside the knowledge bases this key may use

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Slug or translation already exists

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Rejected by validation (e.g. unknown language or category)

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Rate limited; see Retry-After

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Internal error