import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.tickets.updateTicket({
ticket_id: 'ACM-001',
subject: 'Customer cannot access invoices',
});
console.log(response);
}
main();curl -X PATCH 'https://api.periskope.app/v1/tickets/ACM-001' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"subject": "Customer cannot access invoices"
}'{
"chat": {
"org_id": "00000000-0000-0000-0000-000000000000",
"chat_id": "120363000000000000@g.us",
"members": {
"key": {
"contact_id": "911111111111@c.us",
"chat_id": "120363000000000000@g.us",
"org_id": "00000000-0000-0000-0000-000000000000",
"org_phone": "911111111111@c.us",
"is_admin": false,
"is_super_admin": false,
"contact_name": "Rahul Sharma",
"contact_image": "https://example.com/files/image.png",
"contact_color": "#7D9EF1",
"is_internal": false,
"contact_labels": "vip, billing"
}
},
"is_muted": false,
"chat_name": "Example Corp Support",
"chat_type": "group",
"org_phone": "911111111111@c.us",
"chat_image": "https://example.com/files/image.png",
"created_at": "2026-01-10T08:00:00+00:00",
"chat_labels": "customer, priority",
"invite_link": null,
"group_description": null,
"custom_properties": {
"Region": "EMEA"
},
"freshdesk_metadata": {},
"zohodesk_metadata": {},
"initiated_by": null,
"is_archived": false,
"parent_community_id": null
},
"message": {
"message_id": "false_120363000000000000@g.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"chat_id": "120363000000000000@g.us",
"org_phone": "911111111111@c.us",
"timestamp": "2026-01-15T09:28:00+00:00",
"body": "I cannot open my invoices from the portal",
"media_path": "",
"sender_phone": "911111111111",
"sender_name": "Rahul Sharma",
"performed_by": null
},
"ticket": {
"ticket_id": "ACM-001",
"org_id": "00000000-0000-0000-0000-000000000000",
"subject": "Customer cannot access invoices",
"status": "open",
"priority": 2,
"assignee": "user@example.com",
"assigned_by": "",
"raised_by": "api",
"due_date": "2026-02-01 00:00:00+00",
"ticket_labels": "urgent, billing",
"ticket_custom_properties": {
"Workspace": "Example Corp"
},
"quoted_message_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"created_at": "2026-01-15T09:30:00.000Z",
"closed_at": null,
"closed_by": null,
"closed_message": null,
"first_assigned_at": null,
"is_deleted": false
},
"attached_messages": [
{
"message_id": "false_120363000000000000@g.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"chat_id": "120363000000000000@g.us",
"org_phone": "911111111111@c.us",
"timestamp": "2026-01-15T09:28:00+00:00",
"body": "I cannot open my invoices from the portal",
"media_path": "",
"sender_phone": "911111111111",
"sender_name": "Rahul Sharma",
"performed_by": null
}
]
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "NOT_FOUND_ERROR",
"message": "No ticket matches ticket_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 Ticket
Updates a ticket — any combination of the body fields, at least one required. labels replaces the entire label set.
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.tickets.updateTicket({
ticket_id: 'ACM-001',
subject: 'Customer cannot access invoices',
});
console.log(response);
}
main();curl -X PATCH 'https://api.periskope.app/v1/tickets/ACM-001' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"subject": "Customer cannot access invoices"
}'{
"chat": {
"org_id": "00000000-0000-0000-0000-000000000000",
"chat_id": "120363000000000000@g.us",
"members": {
"key": {
"contact_id": "911111111111@c.us",
"chat_id": "120363000000000000@g.us",
"org_id": "00000000-0000-0000-0000-000000000000",
"org_phone": "911111111111@c.us",
"is_admin": false,
"is_super_admin": false,
"contact_name": "Rahul Sharma",
"contact_image": "https://example.com/files/image.png",
"contact_color": "#7D9EF1",
"is_internal": false,
"contact_labels": "vip, billing"
}
},
"is_muted": false,
"chat_name": "Example Corp Support",
"chat_type": "group",
"org_phone": "911111111111@c.us",
"chat_image": "https://example.com/files/image.png",
"created_at": "2026-01-10T08:00:00+00:00",
"chat_labels": "customer, priority",
"invite_link": null,
"group_description": null,
"custom_properties": {
"Region": "EMEA"
},
"freshdesk_metadata": {},
"zohodesk_metadata": {},
"initiated_by": null,
"is_archived": false,
"parent_community_id": null
},
"message": {
"message_id": "false_120363000000000000@g.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"chat_id": "120363000000000000@g.us",
"org_phone": "911111111111@c.us",
"timestamp": "2026-01-15T09:28:00+00:00",
"body": "I cannot open my invoices from the portal",
"media_path": "",
"sender_phone": "911111111111",
"sender_name": "Rahul Sharma",
"performed_by": null
},
"ticket": {
"ticket_id": "ACM-001",
"org_id": "00000000-0000-0000-0000-000000000000",
"subject": "Customer cannot access invoices",
"status": "open",
"priority": 2,
"assignee": "user@example.com",
"assigned_by": "",
"raised_by": "api",
"due_date": "2026-02-01 00:00:00+00",
"ticket_labels": "urgent, billing",
"ticket_custom_properties": {
"Workspace": "Example Corp"
},
"quoted_message_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"created_at": "2026-01-15T09:30:00.000Z",
"closed_at": null,
"closed_by": null,
"closed_message": null,
"first_assigned_at": null,
"is_deleted": false
},
"attached_messages": [
{
"message_id": "false_120363000000000000@g.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"chat_id": "120363000000000000@g.us",
"org_phone": "911111111111@c.us",
"timestamp": "2026-01-15T09:28:00+00:00",
"body": "I cannot open my invoices from the portal",
"media_path": "",
"sender_phone": "911111111111",
"sender_name": "Rahul Sharma",
"performed_by": null
}
]
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "NOT_FOUND_ERROR",
"message": "No ticket matches ticket_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
Unique id of the ticket (e.g. ACM-001) — the ticket_id returned when the ticket was created
1"ACM-001"
Body
New subject for the ticket
1"Customer cannot access invoices"
Email of the member to assign the ticket to. Must be the email of a member of the organization. Pass null or an empty string to unassign the ticket.
"user@example.com"
New status of the ticket: 'open', 'inprogress', 'closed' or 'archived'. Setting 'closed' stamps closed_at and records closed_by/closed_message; setting 'open' or 'inprogress' reopens the ticket and clears them. An empty string is ignored (the status is left unchanged).
"closed"
New due date of the ticket. Accepts ISO 8601 (e.g. 2026-02-01T00:00:00Z) and any format parseable as a JavaScript date (YYYY-MM-DD, MM/DD/YYYY, etc.). Epoch timestamps are not supported. Pass null or an empty string to clear the due date.
"2026-02-01"
Priority of the ticket as a string: '1' (low), '2' (medium), '3' (high) or '4' (urgent). An empty string is ignored (the priority is left unchanged/unset).
"2"
Comma-separated list of ticket label names, matched case-insensitively. Replaces the entire label set of the ticket. Labels that do not exist yet are created automatically. Pass null or an empty string to remove every label from the ticket.
"urgent, billing"
Ticket custom property values to set, as a map of property name or property_id (case-insensitive) → value. Values are validated against the property definitions of the workspace (see the CustomProperty component and the Properties endpoints): text takes any string, date any parseable date, dropdown an option id or label, picklist an array or comma-separated string of option ids or labels, dependent_dropdown an array of per-level ids/labels or a dot-joined id path. file properties cannot be updated via the API. Pass null, an empty string or an empty array as a value to clear that property; properties not included are left unchanged. Passing null or an empty object as custom_properties changes nothing.
{ "Workspace": "Example Corp" }
Email of the member closing the ticket, recorded in close_ticket_metadata. Only used together with status 'closed'; must be the email of a member of the organization. Defaults to 'api' when omitted.
"user@example.com"
Closing message recorded in close_ticket_metadata. Only used together with status 'closed'.
"Resolved over call"
Response
The updated ticket with its chat and quoted message
A ticket together with its chat, the message it was raised from and (on GET /tickets/{ticket_id}) the messages attached to it.
The chat the ticket is raised on. null in the rare case the chat record is no longer available.
Show child attributes
Show child attributes
The message the ticket was raised from (quoted_message_id). Always present as an object — every field in it is null when the ticket is not linked to a message.
Show child attributes
Show child attributes
The ticket itself
Show child attributes
Show child attributes
Messages attached to the ticket. Populated only by GET /tickets/{ticket_id} — always an empty array in create and update responses.
Show child attributes
Show child attributes
Was this page helpful?