Labels
Organize emails with custom labels. Labels can be applied manually or automatically via inbox rules.
Response 200
Example Responsejson
{
"labels": [
{
"id": "lbl_Kp9xMn2qLr4vTt7bYw3cZ",
"name": "Important",
"color": "#ef4444",
"createdAt": "2025-01-29T12:00:00.000Z"
}
],
"limit": 10,
"used": 1
}Rate Limits
FreeN/A (Pro only)
Pro30 req/min
Business60 req/min
Code Examples
curl https://destroy.network/api/labels \
-H "Authorization: Bearer sk_live_your_api_key"Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Label name (1-50 characters) |
color | string | No | Hex color code (default: #8b5cf6) |
Example Requestjson
{
"name": "Important",
"color": "#ef4444"
}Response 201
Example Responsejson
{
"id": "lbl_Kp9xMn2qLr4vTt7bYw3cZ",
"name": "Important",
"color": "#ef4444",
"createdAt": "2025-01-29T12:00:00.000Z"
}Errors
| Status | Message |
|---|---|
| 400 | Maximum N labels allowed on your plan |
| 409 | A label with this name already exists |
Rate Limits
FreeN/A (Pro only)
Pro10 req/min
Business30 req/min
Code Examples
curl -X POST https://destroy.network/api/labels \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "Important", "color": "#ef4444"}'Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Label ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New label name |
color | string | No | New hex color code |
Example Requestjson
{
"name": "Very Important",
"color": "#dc2626"
}Response 200
Example Responsejson
{
"success": true
}Errors
| Status | Message |
|---|---|
| 404 | Label not found |
| 409 | A label with this name already exists |
Rate Limits
FreeN/A (Pro only)
Pro10 req/min
Business30 req/min
Code Examples
curl -X PATCH https://destroy.network/api/labels/lbl_Kp9xMn2qLr4vTt7bYw3cZ \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"color": "#dc2626"}'DELETE
Auth Required/api/labels/{id}Delete Label
Remove a label. This also removes the label from all messages.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Label ID |
Response 200
Example Responsejson
{
"success": true
}Errors
| Status | Message |
|---|---|
| 404 | Label not found |
Rate Limits
FreeN/A (Pro only)
Pro10 req/min
Business30 req/min
Code Examples
curl -X DELETE https://destroy.network/api/labels/lbl_Kp9xMn2qLr4vTt7bYw3cZ \
-H "Authorization: Bearer sk_live_your_api_key"POST
Auth Required/api/labels/messages/{messageId}/labels/{labelId}Add Label to Message
Apply a label to a specific message.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
messageId | string | Yes | Message ID |
labelId | string | Yes | Label ID |
Response 200
Example Responsejson
{
"success": true
}Errors
| Status | Message |
|---|---|
| 404 | Message not found |
| 404 | Label not found |
Rate Limits
FreeN/A (Pro only)
Pro30 req/min
Business60 req/min
Code Examples
curl -X POST https://destroy.network/api/labels/messages/msg_abc123/labels/lbl_def456 \
-H "Authorization: Bearer sk_live_your_api_key"DELETE
Auth Required/api/labels/messages/{messageId}/labels/{labelId}Remove Label from Message
Remove a label from a specific message.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
messageId | string | Yes | Message ID |
labelId | string | Yes | Label ID |
Response 200
Example Responsejson
{
"success": true
}Rate Limits
FreeN/A (Pro only)
Pro30 req/min
Business60 req/min
Code Examples
curl -X DELETE https://destroy.network/api/labels/messages/msg_abc123/labels/lbl_def456 \
-H "Authorization: Bearer sk_live_your_api_key"GET
Auth Required/api/labels/messages/{messageId}Get Labels for Message
Get all labels applied to a specific message.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
messageId | string | Yes | Message ID |
Response 200
Example Responsejson
{
"labels": [
{
"id": "lbl_Kp9xMn2qLr4vTt7bYw3cZ",
"name": "Important",
"color": "#ef4444",
"appliedAt": "2025-01-29T12:00:00.000Z",
"appliedByRuleId": "rule_abc123"
}
]
}Errors
| Status | Message |
|---|---|
| 404 | Message not found |
Rate Limits
FreeN/A (Pro only)
Pro30 req/min
Business60 req/min
Code Examples
curl https://destroy.network/api/labels/messages/msg_abc123 \
-H "Authorization: Bearer sk_live_your_api_key"appliedByRuleId is set if the label was applied automatically by a rule.
Manual labels have appliedByRuleId set to null.
