Overview
Labels in Jasni allow you to categorize and organize emails. Unlike folders, an email can have multiple labels, making it easy to classify emails by topic, priority, or any custom criteria. Labels are particularly useful for AI agents that need to classify and route incoming emails.Label Structure
A label object contains:| Field | Type | Description |
|---|---|---|
id | uuid | Unique identifier |
name | string | Label name (1-50 characters) |
color | string | Hex color code (e.g., #6366f1) |
description | string | Optional description |
created_at | datetime | Creation timestamp |
email_count | integer | Number of emails (when requested) |
Creating Labels
Create a new label with a name and optional color:If no color is provided, a random color from a predefined palette will be assigned.
Color Format
Colors must be in hex format:#RRGGBB
Listing Labels
Retrieve all labels for your account:Response
Use Cases
AI Email Classification
Use labels to let your AI agent classify incoming emails:Priority Management
Create a priority system with labels:Department Routing
Route emails to different teams:Suggested Label Colors
Here’s a palette of colors that work well together:| Color | Hex | Use Case |
|---|---|---|
| 🔴 Red | #ef4444 | Urgent, Important |
| 🟠 Orange | #f97316 | High Priority |
| 🟡 Yellow | #eab308 | Needs Attention |
| 🟢 Green | #22c55e | Resolved, Done |
| 🔵 Blue | #3b82f6 | Information |
| 🟣 Purple | #8b5cf6 | Personal |
| 🩷 Pink | #ec4899 | Marketing |
| 🩵 Cyan | #06b6d4 | Technical |
Best Practices

Use descriptive names
Use descriptive names
Choose clear, descriptive label names that are easy to understand at a glance.

Limit the number of labels
Limit the number of labels
Too many labels can be overwhelming. Aim for 10-20 well-organized labels.

Use consistent colors
Use consistent colors
Establish a color scheme (e.g., red for urgent, green for resolved) and stick to it.

Combine with webhooks
Combine with webhooks
Use webhooks to automatically apply labels when emails arrive based on rules or AI classification.