POST/datasets/tags/binding

Create Tag Binding

Bind one or more tags to a knowledge base. A knowledge base can have multiple tags.

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

2 body fields
tag_idsarray<string>required
IDs of the tags to bind. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags). Unknown tag IDs are silently ignored.
target_idstringrequired
Knowledge base to bind the tags to. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases).

3 status codes
204Success.
403`forbidden` : The API key is scoped to specific knowledge bases. Scope is checked only against a knowledge base ID in the path, not `target_id`, so this endpoint requires a key with access to all knowledge bases.

One documented failure

  • forbidden

    The API key is not authorized to access this knowledge base.

    forbidden (key scope)

404`not_found` : The target knowledge base does not exist.

One documented failure

  • not_found

    Dataset not found

    not_found

Error handling

A 403 is returned: forbidden : The API key is scoped to specific knowledge bases. Scope is checked only against a knowledge base ID in the path, not target_id, so this endpoint requires a key with access to all knowledge bases. A 404 is returned: not_found : The target knowledge base does not exist.