import { PeriskopeApi } from '@periskope/periskope-client';

const client = new PeriskopeApi({
  authToken: 'YOUR_API_KEY',
  phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});

async function updateChatLabels() {
  const response = await client.chat.updateLabels({
    labels: '< LABEL 1 > , < LABEL 2 >',
    chat_ids: ['< CHAT_ID 1 >', '< CHAT_ID 2 >']
  });

  console.log(response);
}

updateChatLabels();
{}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-phone
string

Please provide the number of the phone you want to call with this API in the header. The number must be in country code + number format without any characters or spaces, e.g. 919876543210; Alternatively, provide the phone_id (phone-xxxxxxxxxxxx) in the header

Example:

"{{orgPhone}}"

Body

application/json
labels
string
required
  • A comma-separated list of labels to be assigned to the chats. All labels are case-insensitive.
  • If any label currently does not exist, it will be created
  • Note: This replaces all the current labels of the chat
chat_ids
string[]
required
  • An array of chat_ids to update

Response

204
application/json
204 OK

204 No Content