Rest API
Create or update a help center category
POST
/api/v1/help-center/categories
const url = 'https://api.unless.com/api/v1/help-center/categories';const options = { method: 'POST', headers: { 'x-api-key': 'example', 'x-user-email': 'example', 'x-account-id': 'example', 'x-website-id': 'example', 'Content-Type': 'application/json' }, body: '{"category":{"name":"Billing","websiteId":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","description":"Invoices, plans and payment questions.","order":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.unless.com/api/v1/help-center/categories \ --header 'Content-Type: application/json' \ --header 'x-account-id: example' \ --header 'x-api-key: example' \ --header 'x-user-email: example' \ --header 'x-website-id: example' \ --data '{ "category": { "name": "Billing", "websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "description": "Invoices, plans and payment questions.", "order": 1 } }'Create a category, or update an existing one by passing its categoryId.
Notes
category.websiteIdmust be set in the body as well as in thex-website-idheader- The URL slug is derived from the name and kept unique within the workspace. An existing category keeps its slug across a rename so published URLs stay stable; pass
slugexplicitly to override - Changes only reach visitors after
POST /api/v1/help-center/publish - Deleting a category is not available with an API key, only from the dashboard
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”x-api-key
required
string
Your API key from account settings.
x-user-email
required
string
The email address of your user.
x-account-id
required
string
The ID of your account. You can find this in the account settings.
x-website-id
required
string
The ID of the workspace you want to use.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
category
required
object
categoryId
ID of an existing category to update. Omit to create a new one.
string
name
required
string
websiteId
required
string
description
string
order
Sort position. Defaults to 0.
number
slug
URL slug. Derived from the name when omitted.
string
translationContext
string
Example
{ "category": { "name": "Billing", "websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "description": "Invoices, plans and payment questions.", "order": 1 }}Responses
Section titled “Responses”The stored category.
Bad request - missing websiteId, category name or category websiteId.
Unauthorized - invalid API key.