import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.properties.updatePropertyOptions({
property_id: 'property-aaaaaaaaaaaa',
operation: 'add',
options: [
'Example Corp',
'Globex',
],
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/properties/property-aaaaaaaaaaaa/options' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"operation": "add",
"options": [
"Example Corp",
"Globex"
]
}'{
"success": true,
"message": "Options updated",
"data": {
"property_id": "property-aaaaaaaaaaaa",
"operation": "add",
"options": [
{
"id": "1755859200000",
"label": "Example Corp",
"added": null,
"removed": null
}
]
}
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "NOT_FOUND_ERROR",
"message": "No custom property matches property_id",
"status": 404
}{
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"status": 422,
"fields": {
"body.chat_id": {
"message": "chat_id is required"
}
}
}{
"code": "RATE_LIMIT_ERROR",
"message": "You can only make 100 requests per second",
"status": 429
}{
"code": "UNKNOWN_ERROR",
"message": "Internal server error",
"status": 500
}Update Property Options
Adds or removes options on a dropdown or picklist property. Adding is idempotent on the label (case-insensitive).
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.properties.updatePropertyOptions({
property_id: 'property-aaaaaaaaaaaa',
operation: 'add',
options: [
'Example Corp',
'Globex',
],
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/properties/property-aaaaaaaaaaaa/options' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"operation": "add",
"options": [
"Example Corp",
"Globex"
]
}'{
"success": true,
"message": "Options updated",
"data": {
"property_id": "property-aaaaaaaaaaaa",
"operation": "add",
"options": [
{
"id": "1755859200000",
"label": "Example Corp",
"added": null,
"removed": null
}
]
}
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "NOT_FOUND_ERROR",
"message": "No custom property matches property_id",
"status": 404
}{
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"status": 422,
"fields": {
"body.chat_id": {
"message": "chat_id is required"
}
}
}{
"code": "RATE_LIMIT_ERROR",
"message": "You can only make 100 requests per second",
"status": 429
}{
"code": "UNKNOWN_ERROR",
"message": "Internal server error",
"status": 500
}Authorizations
Your Periskope API token, sent as Authorization: Bearer <token>. Generate one from the Periskope dashboard under Settings → API & Webhooks. API access requires an active Pro or Enterprise plan.
Path Parameters
The property_id (property-xxxxxxxxxxxxxxxx) or the name (case-insensitive) of the custom property. Prefer the property_id — a name that exists as both a chat and a ticket property is ambiguous without the type query parameter.
1"property-aaaaaaaaaaaa"
Query Parameters
Resolves the chat or the ticket property when property_id is a name that exists as both. Not needed when passing a property_id, or when the name only exists under one type.
chat, ticket "ticket"
Body
Whether to add the given options to the property ('add') or remove them from it ('remove')
add, remove "add"
For add: the option labels to add — adding is idempotent, labels that already exist (case-insensitive) are skipped and their existing id returned. For remove: the option ids or labels to remove.
1["Example Corp", "Globex"]
Was this page helpful?