You can remove labels from a thread with a call to removeLabels. Label IDs for this call can be retrieved by fetching a thread with the API.

This operation requires the following permissions:

  • label:delete
import { PlainClient } from '@team-plain/typescript-sdk';

const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });

const res = await client.removeLabels({
  labelIds: ['l_01HD428Y1TREH5KTXP019K6FPK'],
});

if (res.error) {
  console.error(res.error);
} else {
  console.log(res.data);
}

Which if successful will console log null.