Skip to main content
{
  "chat": {
    "org_id": "2997xx64-89bf-48d3-9a22-b314fxx017e5",
    "org_phone": "[email protected]",
    "chat_id": "[email protected]",
    "members": {
        "[email protected]": {
            "org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
            "chat_id": "[email protected]",
            "is_admin": true,
            "org_phone": "[email protected]",
            "contact_id": "[email protected]",
            "is_internal": true,
            "contact_name": "Support",
            "contact_color": "#B4876E",
            "contact_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F918527184400%40c.us.jpg?timestamp=1737690126280",
            "is_super_admin": true
        },
        "[email protected]": {
            "org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
            "chat_id": "[email protected]",
            "is_admin": true,
            "org_phone": "[email protected]",
            "contact_id": "[email protected]",
            "is_internal": false,
            "contact_name": "BK Local1",
            "contact_color": "#B4876E",
            "contact_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F919537851844%40c.us.jpg?timestamp=1737689973340",
            "is_super_admin": true
        }
    },
    "is_muted": false,
    "chat_name": "Demo Chat",
    "chat_type": "chat",
    "chat_image": "/storage/image.jpeg",
    "created_at": "2025-01-26T02:30:50+00:00",
    "chat_labels": "label1, label2",
    "invite_link": "https://chat.whatsapp.com/invite/BZcwk7oCxxVIhExxxcmKxN"
    "custom_properties": {
      "Property1": "opXtion1",
      "Property2": "opXtion1",
      "Property3": "opXtion1"
    },
    "group_description": null
  },
  "message": {
    "body": "hello",
    "chat_id": "[email protected]",
    "org_phone": "[email protected]",
    "timestamp": "2024-05-13T17:27:15+00:00",
    "media_path": "/path/to/media",
    "message_id": "[email protected]_3EB0DAB631F7E58XXXXE0C",
    "sender_name": "Periskope Central",
    "performed_by": "[email protected]",
    "sender_phone": "91900438XXXX"
  },
  "ticket": {
    "org_id": "2997xx64-89bf-48d3-9a22-b314fxx017e5",
    "status": "open",
    "subject": "Sample Ticket Subject",
    "assignee": "[email protected]",
    "due_date": "2024-06-15T12:00:00+00:00",
    "priority": 2,
    "closed_at": "2024-06-14T12:00:00+00:00",
    "closed_by": "[email protected]",
    "raised_by": "[email protected]",
    "ticket_id": "TICKET-12345",
    "created_at": "2024-05-24T08:30:00+00:00",
    "is_deleted": false,
    "assigned_by": "[email protected]",
    "ticket_labels": "label1, label2",
    "quoted_message_id": "3EB0DAB631F7E580EAAE0C"
    "ticket_custom_properties": {
          "property-1": "value-1",
          "property-2": "value-2",
          "property-3": "value-3"
      },
    "first_assigned_at" : null
  },
  "attached_messages": [{
    "body": "hello",
    "chat_id": "[email protected]",
    "org_phone": "[email protected]",
    "timestamp": "2024-05-13T17:27:15+00:00",
    "media_path": "/path/to/media",
    "message_id": "[email protected]_3EB0DAB631F7E58XXXXE0C",
    "sender_name": "Periskope Central",
    "performed_by": "[email protected]",
    "sender_phone": "91900438XXXX"
  },{
    "body": "attached message 1",
    "chat_id": "[email protected]",
    "org_phone": "[email protected]",
    "timestamp": "2024-05-13T17:27:15+00:00",
    "media_path": "/path/to/media",
    "message_id": "[email protected]_3EB0DAB631F7E58XXXXE0C",
    "sender_name": "Periskope Central",
    "performed_by": "[email protected]",
    "sender_phone": "91900438XXXX"
  }]
}
This will contain only ticket data and no details regarding the message or chat it has been raised for. To get more details about the chat and message, you can use Get ticket info API.Refer Ticket Info Object to find more details about chat and message details related to the ticket.
import { PeriskopeApi } from '@periskope/periskope-client';

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

client.on('ticket.updated', (data) => {
  console.log(data);
});

Event structure 📦

You’ll be receiving the data in the following format:
{
  "event": "<event-type>",
  "data": "<event-data>", // complete data object as mentioned in Objects section
  "org_id": "<your-organisation-id>",
  "previous_attributes": "<previous-attributes>", // attributes changes in new object. In case of an update event.
  "timestamp": "<timestamp>" // timestamp of the event creation
}