Update articles in bulk
curl --request PATCH \
--url https://{your-subdomain}.neetokb.com/api/external/v2/articles/bulk_update \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"article_ids": [
"getting-started",
"a-84af178b"
],
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
article_ids: ['getting-started', 'a-84af178b'],
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://{your-subdomain}.neetokb.com/api/external/v2/articles/bulk_update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetokb.com/api/external/v2/articles/bulk_update"
payload = {
"article_ids": ["getting-started", "a-84af178b"],
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"updated_articles": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "getting-started"
}
]
}{
"error": "Not found."
}{
"error": "Pass only one of category_id, state or status."
}Articles
Update articles in bulk
This API changes up to 100 articles at once. Send article_ids and exactly one of category_id, state or status. It is all-or-nothing. For CLI sessions, this needs the Modify articles permission. Setting state also needs the Manage articles permission. The put method works too.
PATCH
/
articles
/
bulk_update
Update articles in bulk
curl --request PATCH \
--url https://{your-subdomain}.neetokb.com/api/external/v2/articles/bulk_update \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"article_ids": [
"getting-started",
"a-84af178b"
],
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
article_ids: ['getting-started', 'a-84af178b'],
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://{your-subdomain}.neetokb.com/api/external/v2/articles/bulk_update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetokb.com/api/external/v2/articles/bulk_update"
payload = {
"article_ids": ["getting-started", "a-84af178b"],
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"updated_articles": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "getting-started"
}
]
}{
"error": "Not found."
}{
"error": "Pass only one of category_id, state or status."
}Replace
Learn how to find your subdomain in Workspace subdomain.
{your-subdomain} with your workspace’s subdomain. Learn how to find your subdomain in Workspace subdomain.
Headers
Use the X-Api-Key header to provide your workspace API key. Refer to Authentication for more information.
Body
application/json
Send article_ids and exactly one of category_id, state or status. Sending none, or more than one, returns 422.
Between 1 and 100 articles, each given by slug, permalink identifier or UUID.
Required array length:
1 - 100 elementsExample:
["getting-started", "a-84af178b"]
Moves the articles to this category.
Sets the state of the articles.
Available options:
draft, published Archives or unarchives the articles.
Available options:
archive, active