createTag
Create a new tag record by providing a tag name and existing group ID. Adds a tag to a specified group for categorization.
Instructions
Create a tag - Create a new tag record. Writes live data.
Use when: adding a new tag. Group (group_tag_id) must exist - discover via listTagGroups.
Required: tag_name, group_tag_id.
added_by is wrapper-managed: the audit-trail added_by field is hardcoded to 0 by the wrapper on every create. Not exposed as an input.
Duplicate tag_name silent-accept: BD does NOT enforce a uniqueness constraint on tag_name within a group_tag_id. Two createTag calls with the same tag_name + group_tag_id both succeed and produce two rows with different tag_ids. Downstream createTagRelationship calls then become ambiguous (which of the two tags?). Recommended pre-check pattern: call listTags with property=tag_name&property_value=<name>&property_operator== (optionally filtered further by group_tag_id) BEFORE create. If a match exists, reuse that tag_id rather than creating a duplicate.
Parameter interactions:
tag_name- the visible labelgroup_tag_id- tag group fromlistTagGroups
See also: updateTag (modify existing).
Returns: { status: "success", message: {...createdRecord} } - includes the server-assigned ID. Use this ID for follow-up operations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag_name | Yes | ||
| group_tag_id | Yes | Tag group this tag belongs to (from `listTagGroups`). **BD does NOT enforce FK** — passing `0` or a nonexistent group_tag_id is silently accepted and produces an orphan tag (live observed). Verify the group exists before passing. |