Create a translation of a category in another language
POST
/categories/{id}/translations
const url = 'https://api.motenya.app/v1/categories/example/translations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"language":"en","parentId":"example","slug":"getting-started","name":"example","description":"example","icon":"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/categories/example/translations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "language": "en", "parentId": "example", "slug": "getting-started", "name": "example", "description": "example", "icon": "example", "tags": [ "example" ], "position": 1 }'Requires categories:write. The new category joins the source’s translation group.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
language
required
A language code enabled on the knowledge base, e.g. ‘en’ or ‘ro’.
string
Example
enparentId
Parent category (same KB and language); null for top level.
string | null
slug
required
Lowercase letters, digits and single hyphens; unique per knowledge base and language.
string
Example
getting-startedname
required
string
description
string | null
icon
string | null
tags
Array<string>
position
integer
Responses
Section titled “Responses”Created
Media typeapplication/json
object
id
required
string
kbId
required
string
language
required
string
parentId
required
string | null
slug
required
string
name
required
string
description
required
string | null
icon
required
string | null
tags
required
Array<string>
hidden
required
boolean
translationGroupId
required
string | null
translations
required
Array<object>
object
language
required
string
slug
required
string
children
required
Child categories, recursively.
Array<object>
object
id
required
string
kbId
required
string
language
required
string
parentId
required
string | null
slug
required
string
name
required
string
description
required
string | null
icon
required
string | null
tags
required
Array<string>
hidden
required
boolean
translationGroupId
required
string | null
translations
required
Array<object>
object
language
required
string
slug
required
string
key
additional properties
Example generated
{ "id": "example", "kbId": "example", "language": "example", "parentId": "example", "slug": "example", "name": "example", "description": "example", "icon": "example", "tags": [ "example" ], "hidden": true, "translationGroupId": "example", "translations": [ { "language": "example", "slug": "example" } ], "children": [ { "id": "example", "kbId": "example", "language": "example", "parentId": "example", "slug": "example", "name": "example", "description": "example", "icon": "example", "tags": [ "example" ], "hidden": true, "translationGroupId": "example", "translations": [ { "language": "example", "slug": "example" } ] } ]}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