Skip to main content

Overview

The Tags API allows you to create, manage, and apply tags to mentions for better organization and categorization. Tags support custom colors for visual identification.

Methods

Get Tags

Fetch all tags for an alert.
client.get_tags(
    account_id: str,
    alert_id: str
) -> TagsResponse
account_id
string
required
The account ID
alert_id
string
required
The alert ID
Returns: TagsResponse containing list of tags Example:
from mention import MentionClient

client = MentionClient(access_token="your-token")
tags_response = client.get_tags("acc_123456", "alert_123")

for tag in tags_response.tags:
    print(f"{tag.name} - Color: {tag.color}")
Response:
{
  "tags": [
    {
      "id": "tag_1",
      "name": "Customer Feedback",
      "color": "#4CAF50"
    },
    {
      "id": "tag_2",
      "name": "Bug Report",
      "color": "#F44336"
    },
    {
      "id": "tag_3",
      "name": "Feature Request",
      "color": "#2196F3"
    }
  ]
}

Create Tag

Create a new tag for an alert.
from mention import CreateTagRequest

client.create_tag(
    account_id: str,
    alert_id: str,
    request: CreateTagRequest
) -> Tag
account_id
string
required
The account ID
alert_id
string
required
The alert ID
request
CreateTagRequest
required
Tag creation request
Request Fields:
request.name
string
required
Tag name
request.color
string
Tag color (hex color code, e.g., #4CAF50)
Returns: Created Tag object Example:
from mention import MentionClient, CreateTagRequest

client = MentionClient(access_token="your-token")

request = CreateTagRequest(
    name="Customer Feedback",
    color="#4CAF50"
)

tag = client.create_tag("acc_123456", "alert_123", request)
print(f"Created tag: {tag.id} - {tag.name}")
Response:
{
  "id": "tag_456",
  "name": "Customer Feedback",
  "color": "#4CAF50"
}

Update Tag

Update an existing tag’s name or color.
from mention import UpdateTagRequest

client.update_tag(
    account_id: str,
    alert_id: str,
    tag_id: str,
    request: UpdateTagRequest
) -> Tag
account_id
string
required
The account ID
alert_id
string
required
The alert ID
tag_id
string
required
The tag ID
request
UpdateTagRequest
required
Tag update request (all fields optional)
Returns: Updated Tag object Example:
from mention import UpdateTagRequest

request = UpdateTagRequest(
    name="Customer Feedback (Updated)",
    color="#8BC34A"
)

tag = client.update_tag(
    "acc_123456",
    "alert_123",
    "tag_456",
    request
)

print(f"Updated tag: {tag.name} - {tag.color}")

Delete Tag

Delete a tag permanently.
client.delete_tag(
    account_id: str,
    alert_id: str,
    tag_id: str
) -> bool
account_id
string
required
The account ID
alert_id
string
required
The alert ID
tag_id
string
required
The tag ID
Returns: True if deletion was successful Example:
success = client.delete_tag(
    "acc_123456",
    "alert_123",
    "tag_456"
)

if success:
    print("Tag deleted successfully")

Using Tags with Mentions

Tags can be applied to mentions using the curate_mention method: Example:
Sync
from mention import CurateMentionRequest

# Apply tags to a mention
request = CurateMentionRequest(
    tags=["tag_1", "tag_2", "tag_3"]
)

mention = client.curate_mention(
    "acc_123456",
    "alert_123",
    "mention_789",
    request
)

print(f"Tags applied: {len(mention.tags)}")
for tag in mention.tags:
    print(f"  - {tag.name} ({tag.color})")

Models

Tag

Represents a tag associated with an alert.
FieldTypeDescription
idstringTag ID
namestringTag name
colorstringHex color code (e.g., #4CAF50)

CreateTagRequest

Request for creating a new tag.
FieldTypeRequiredDescription
namestringYesTag name
colorstringNoHex color code

UpdateTagRequest

Request for updating an existing tag.
FieldTypeDescription
namestringNew tag name
colorstringNew hex color code

Color Recommendations

Popular hex color codes for tags:
ColorHex CodeUse Case
Green#4CAF50Positive feedback, success
Red#F44336Issues, bugs, negative
Blue#2196F3Information, general
Orange#FF9800Priority, attention needed
Purple#9C27B0Feature requests
Yellow#FFEB3BPending, waiting
Teal#009688Questions
Pink#E91E63Important

Build docs developers (and LLMs) love