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:
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
.
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
.
mutation removeLabels($input: RemoveLabelsInput!) {
removeLabels(input: $input) {
error {
message
type
code
}
}
}
{
"input": {
"labelIds": ["l_01HB8BTNTZ58730MX8H5VMKFD5", "l_01HB8BTNKSCF1FK5ETFVRSDC6G"]
}
}