PATCH/datasets/tags

Update 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.

2 body fields

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).

4 status codes
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_param

    Tag 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

  • forbidden

    The 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_found

    Tag 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.