curl --request PATCH \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/portals/{id}/categories/{category_id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"name": "Category Name",
"description": "Category description",
"position": 1,
"slug": "category-name",
"locale": "en",
"icon": "📚",
"parent_category_id": 1,
"associated_category_id": 2
}
'const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Category Name',
description: 'Category description',
position: 1,
slug: 'category-name',
locale: 'en',
icon: '📚',
parent_category_id: 1,
associated_category_id: 2
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/portals/{id}/categories/{category_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/portals/{id}/categories/{category_id}"
payload = {
"name": "Category Name",
"description": "Category description",
"position": 1,
"slug": "category-name",
"locale": "en",
"icon": "📚",
"parent_category_id": 1,
"associated_category_id": 2
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"description": "<string>",
"locale": "<string>",
"name": "<string>",
"slug": "<string>",
"position": 123,
"portal_id": 123,
"account_id": 123,
"associated_category_id": 123,
"parent_category_id": 123
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{}Update a category
Update a category in a help center portal.
curl --request PATCH \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/portals/{id}/categories/{category_id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"name": "Category Name",
"description": "Category description",
"position": 1,
"slug": "category-name",
"locale": "en",
"icon": "📚",
"parent_category_id": 1,
"associated_category_id": 2
}
'const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Category Name',
description: 'Category description',
position: 1,
slug: 'category-name',
locale: 'en',
icon: '📚',
parent_category_id: 1,
associated_category_id: 2
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/portals/{id}/categories/{category_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/portals/{id}/categories/{category_id}"
payload = {
"name": "Category Name",
"description": "Category description",
"position": 1,
"slug": "category-name",
"locale": "en",
"icon": "📚",
"parent_category_id": 1,
"associated_category_id": 2
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"description": "<string>",
"locale": "<string>",
"name": "<string>",
"slug": "<string>",
"position": 123,
"portal_id": 123,
"account_id": 123,
"associated_category_id": 123,
"parent_category_id": 123
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{}Authorizations
Token de usuario. Envía el valor en el header api_access_token. Lo obtienes en el perfil (GET /api/v1/profile) o al regenerarlo.
Path Parameters
The slug identifier of the portal
The numeric ID of the account
Body
The name of the category
"Category Name"
A description for the category
"Category description"
Category position in the portal list to sort
1
The category slug used in the URL
"category-name"
The locale of the category
"en"
The icon of the category as a string (emoji)
"📚"
To define parent category, e.g product documentation has multiple level features in sales category or in engineering category.
1
To associate similar categories to each other, e.g same category of product documentation in different languages
2
Response
Success
The text content.
To associate similar categories to each other, e.g same category of product documentation in different languages
To define parent category, e.g product documentation has multiple level features in sales category or in engineering category.