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

const client = createClient(); // reads MAILS_API_KEY

const result = await client.labels.get(
  "lbl_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);
{
  "id": "lbl_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  "name": "<name>",
  "color": "gray",
  "created_at": "2026-10-04T12:00:00.000Z",
  "updated_at": "2026-10-04T12:00:00.000Z"
}

Retrieve a label

GET/v1/labels/{id}scope · read
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.labels.get(
  "lbl_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);
{
  "id": "lbl_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  "name": "<name>",
  "color": "gray",
  "created_at": "2026-10-04T12:00:00.000Z",
  "updated_at": "2026-10-04T12:00:00.000Z"
}

Path Parameters

idstringrequired

Label id (lbl_…).

Response

idstring

Label id (lbl_…).

namestring

Unique in the workspace, ignoring case.

colorstring

The label's colour, one of 12 palette names: gray unless another was chosen.

One of: gray, red, orange, amber, yellow, green, teal, cyan, blue, indigo, purple, pink

created_atstring

When the label was created (UTC).

updated_atstring

When the label was last changed with PATCH, even by a request that left it as it was. Equal to created_at on a label never patched.

Was this page helpful?