Update Knowledge Entry
Update a knowledge entry. If content changes, embeddings are automatically regenerated.
Request
curl -X PATCH "https://platform.protobox.ai/api/v1/knowledge/695c71705a8b2ca8d9016050" \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Return Policy",
"content": "Our updated return policy allows returns within 60 days...",
"metadata": {
"category": "policies",
"tags": ["returns", "refunds", "2024"]
}
}'const response = await fetch('https://platform.protobox.ai/api/v1/knowledge/695c71705a8b2ca8d9016050', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer ' + accessToken,
'Content-Type': 'application/json',
},
body: JSON.stringify({
title: 'Updated Return Policy',
metadata: {
tags: ['returns', 'refunds', '2024']
}
})
});
const { data } = await response.json();
console.log('Updated:', data.title);import requests
response = requests.patch(
'https://platform.protobox.ai/api/v1/knowledge/695c71705a8b2ca8d9016050',
headers={'Authorization': f'Bearer {access_token}'},
json={
'title': 'Updated Return Policy',
'metadata': {
'tags': ['returns', 'refunds', '2024']
}
}
)
entry = response.json()['data']
print(f"Updated: {entry['title']}")Response
{
"success": true,
"data": {
"id": "695c71705a8b2ca8d9016050",
"workspaceId": "674e1234567890abcdef0001",
"title": "Updated Return Policy",
"content": "Our updated return policy allows returns within 60 days...",
"source": "manual",
"metadata": {
"category": "policies",
"tags": ["returns", "refunds", "2024"]
},
"isEnabled": true,
"tokenCount": 45,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-16T14:00:00Z"
}
}Path Parameters
idstringrequiredKnowledge entry ID.
Request Body
titlestringUpdated title. Max 500 characters.
contentstringUpdated content. Max 100,000 characters. Triggers embedding regeneration.
metadataobjectUpdated metadata.
metadata properties
metadata.categorystringCategory for organizing entries.
metadata.tagsarrayTags for filtering.
metadata.authorstringAuthor of the content.
isEnabledbooleanWhether the entry is enabled for search.
Notes
- When
contentis updated, vector embeddings are automatically regenerated - Partial updates are supported - only include fields you want to change
- The
searchableTextfield is automatically updated when content changes