Skip to main content
Node.js
import { PeriskopeApi } from '@periskope/periskope-client';

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

async function updatePropertyOptions() {
  const response = await client.property.updateOptions({
    property_id: 'Workspace',
    type: 'ticket',
    operation: 'add',
    options: ['Acme Corp', 'Globex']
  });

  console.log(response);
}

updatePropertyOptions();
{
  "success": true,
  "message": "Options updated",
  "data": {
    "property_id": "property-a1b2c3",
    "operation": "add",
    "options": [
      {
        "id": "1712345678901",
        "label": "Acme Corp",
        "added": true,
        "removed": true
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

property_id
string
required

The property_id (e.g. property-xxxx) or the property_name of the custom property

Query Parameters

type
enum<string>

Specifies whether to resolve the chat or the ticket property when the same name exists under both

Available options:
chat,
ticket

Body

application/json
operation
enum<string>
required
  • Whether to add or remove the given options
Available options:
add,
remove
Example:

"add"

options
string[]
required
  • For add: the labels to add
  • For remove: the option ids or labels to remove
Example:
["Acme Corp", "Globex"]

Response

200 OK

success
boolean
Example:

true

message
string
Example:

"Options updated"

data
object