add_tag
Attach a tag to a Kommo lead by name, creating it if missing while keeping existing tags. Safe to repeat and returns the updated lead.
Instructions
Attach a tag to a lead by name. Creates the tag if it does not exist. Reads the lead's current tags and writes back the full list plus the new one, so existing tags are kept. Safe to repeat. Returns the updated lead. See list_tags for existing tag names.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lead_id | Yes | Kommo lead ID (integer). Obtain it from list_leads or from the create_lead result. | |
| tag_name | Yes | Exact tag name (case-sensitive), e.g. "vip". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Lead ID. | |
| name | No | Lead name. | |
| price | No | Lead budget. | |
| _links | No | HAL links as returned by Kommo (self, next, ...). | |
| group_id | No | ID of the responsible user's group. | |
| _embedded | No | Embedded tags, contacts and companies. | |
| closed_at | No | Closing time, Unix seconds, or null. | |
| status_id | No | Current stage ID. | |
| account_id | No | Kommo account ID. | |
| created_at | No | Creation time, Unix seconds. | |
| created_by | No | ID of the user who created it. | |
| is_deleted | No | Whether the lead is deleted. | |
| updated_at | No | Last update time, Unix seconds. | |
| updated_by | No | ID of the user who last updated it. | |
| pipeline_id | No | Pipeline ID. | |
| loss_reason_id | No | Loss reason ID, or null. | |
| closest_task_at | No | Next task deadline, Unix seconds, or null. | |
| responsible_user_id | No | ID of the responsible Kommo user. | |
| custom_fields_values | No | Custom field values in Kommo format: objects with field_id, field_code and values. |