POST/datasets/tags

Create a knowledge base tag

Creates a tag for organizing knowledge bases. Supply a unique name between 1 and 50 characters to create the tag.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 body field

The name of the knowledge base tag to create.

namestringrequired
Tag name. Must be unique within the workspace.

3 status codes
200Returns the created 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)

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. name is required and must be between 1 and 50 characters.