PATCH
/datasets/tagsUpdate a knowledge base tag
Updates the name of a knowledge base tag. Supply tag_id and a unique name between 1 and 50 characters to rename the tag.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
The new name for the knowledge base tag. Both tag_id and name are required.
namestringrequired
New name for the tag. Must be unique within the workspace.
tag_idstringrequired
ID of the tag to rename. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags).
200Returns the updated tag object, including its identifier, display name, type, and binding count.
binding_countstringoptional
Number of knowledge bases bound to this tag.
idstringoptional
Tag identifier.
namestringoptional
Tag display name.
typestringoptional
Tag type. Always `knowledge` for knowledge base tags.
400Returned when a knowledge tag with the requested name already exists.
One documented failure
invalid_paramTag name already exists
invalid_param
403Returned when the API key is scoped to specific knowledge bases and does not have access to all knowledge bases.
One documented failure
forbiddenThe API key is not authorized to access this knowledge base.
forbidden (key scope)
404Returned when the specified tag does not exist.
One documented failure
not_foundTag not found
not_found
Error handling
A 400 is returned when name duplicates an existing knowledge tag. A 403 is returned when the API key is scoped to specific knowledge bases and does not have access to all knowledge bases. A 404 is returned when tag_id does not identify an existing tag; tag_id and name are required, and name must be 1 to 50 characters.