Skip to content

Create a product

POST
/products
curl --request POST \
--url https://api.motenya.app/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "businessType": "ecommerce", "modules": { "knowledgeBase": true, "ticketing": true }, "knowledgeBase": { "slug": "casa-verde", "language": "ro", "name": "example" } }'

A new product with the modules chosen, each billed per month from now (as when the owner adds one in the admin). With the knowledge base on, give knowledgeBase and its KB is created too. Its slug and language are checked first (SLUG_TAKEN, SLUG_INVALID, LANGUAGE_INVALID: nothing is created). If the KB still can’t be made, the product stays without the knowledge base module and KNOWLEDGE_BASE_NOT_CREATED names it: don’t create it again; switch the module on in the admin. Email channels, domains and the team are set up in the admin. Only the account owner can give a key products:write, and a key limited to some products cannot create one.

Requires products:write.

Media typeapplication/json
object
name
required
string
>= 1 characters <= 80 characters
businessType
required

Picks the CRM vocabulary.

string
Allowed values: ecommerce saas
modules
required

Omitted modules are off on a new product and unchanged on an update.

object
knowledgeBase

Billed per month while on.

boolean
ticketing

Tickets and the CRM; billed per month while on.

boolean
knowledgeBase

Required with modules.knowledgeBase: the KB is created with the product.

object
slug
required

Its address on the help-center domain: lowercase letters, digits and single hyphens, unique in the account.

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

Example

casa-verde
language
required

Its first (default) language, e.g. ro or en.

string
>= 2 characters <= 10 characters

Example

ro
name

Its name in that language; the product name when omitted.

string | null
<= 120 characters

Success

Media typeapplication/json
object
id
required
string
>= 1 characters <= 64 characters
name
required
string | null
businessType
required

Picks the CRM vocabulary; changes no data.

string
Allowed values: ecommerce saas
modules
required
object
knowledgeBase
required
boolean
ticketing
required

Tickets and the CRM; their operations fail with TICKETING_DISABLED while off.

boolean

Example

{
"businessType": "ecommerce"
}

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