NEW

Organize emails with custom labels. Labels can be applied manually or automatically via inbox rules.

GET/api/labels
Auth Required

Get all labels for your account.

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"
POST/api/labels
Auth Required

Create a new label for organizing emails.

Request Body

FieldTypeRequiredDescription
namestringYesLabel name (1-50 characters)
colorstringNoHex 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

StatusMessage
400Maximum N labels allowed on your plan
409A 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"}'
PATCH/api/labels/{id}
Auth Required

Update a label's name or color.

Path Parameters

NameTypeRequiredDescription
idstringYesLabel ID

Request Body

FieldTypeRequiredDescription
namestringNoNew label name
colorstringNoNew hex color code
Example Requestjson
{
  "name": "Very Important",
  "color": "#dc2626"
}

Response 200

Example Responsejson
{
  "success": true
}

Errors

StatusMessage
404Label not found
409A 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/api/labels/{id}
Auth Required

Remove a label. This also removes the label from all messages.

Path Parameters

NameTypeRequiredDescription
idstringYesLabel ID

Response 200

Example Responsejson
{
  "success": true
}

Errors

StatusMessage
404Label 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/api/labels/messages/{messageId}/labels/{labelId}
Auth Required

Apply a label to a specific message.

Path Parameters

NameTypeRequiredDescription
messageIdstringYesMessage ID
labelIdstringYesLabel ID

Response 200

Example Responsejson
{
  "success": true
}

Errors

StatusMessage
404Message not found
404Label 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/api/labels/messages/{messageId}/labels/{labelId}
Auth Required

Remove a label from a specific message.

Path Parameters

NameTypeRequiredDescription
messageIdstringYesMessage ID
labelIdstringYesLabel 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/api/labels/messages/{messageId}
Auth Required

Get all labels applied to a specific message.

Path Parameters

NameTypeRequiredDescription
messageIdstringYesMessage ID

Response 200

Example Responsejson
{
  "labels": [
    {
      "id": "lbl_Kp9xMn2qLr4vTt7bYw3cZ",
      "name": "Important",
      "color": "#ef4444",
      "appliedAt": "2025-01-29T12:00:00.000Z",
      "appliedByRuleId": "rule_abc123"
    }
  ]
}

Errors

StatusMessage
404Message 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.