Skip to main content
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.labels.remove(
  "lbl_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);
{
  "id": "lbl_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  "deleted": false
}

Delete a label

Deletes the label and takes it off every thread that carries it.
DELETE/v1/labels/{id}scope · manage
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.labels.remove(
  "lbl_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);
{
  "id": "lbl_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  "deleted": false
}

Path Parameters

idstringrequired

Label id (lbl_…).

Response

idstring

The deleted label's id (lbl_…).

deletedboolean

Always true: the label is deleted, and its name is taken off every thread that carried it.

Was this page helpful?