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

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

async function updateLabels() {
  const response = await client.contact.updateLabels({
    contact_ids: ['919537851844'],
    labels: 'Test, Demo'
  });

  console.log(response);
}

updateLabels();
{}

Authorizations

Authorization
string
header
required

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

Body

application/json
labels
string
required
  • A comma-separated list of labels to be assigned to the contacts. 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 contact
contact_ids
string[]
required
  • An array of contact_ids to update

Response

204
application/json
204 OK

204 No Content