TypeScript
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
}Custom Property APIs
Update Property Options
Adds or removes options on a dropdown or picklist property. Adding is idempotent on the label (case-insensitive).
TypeScript
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
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.
Minimum string length:
1Example:
"property-aaaaaaaaaaaa"
Query Parameters
Body
application/json
Was this page helpful?