import { PeriskopeApi } from '@periskope/periskope-client';

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

client.on('note.created', (data) => {
  console.log(data);
});
  {
      "message_id": "true_2634e275-ac58-4c85-892d-83882810fc1c_api",
      "org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
      "ack": "3",
      "body": "Hello World",
      "from_me": true,
      "message_type": "chat",
      "chat_id": "918824248940@c.us",
      "timestamp": "2025-08-18T13:38:37.203+00:00",
      "org_phone": "918824248940@c.us",
      "performed_by": "api",
      "prev_body": null,
      "quoted_message_id": "52643136-1573-4011-ad22-b95ca6ea8e0c",
      "sender_phone": "918824248940@c.us",
      "sent_message_id": "2634e275-ac58-4c85-892d-83882810fc1c",
      "updated_at": "2025-08-18T13:38:37.203+00:00",
      "is_private_note": true,
      "unique_id": "2634e275-ac58-4c85-892d-83882810fc1c",
      "mentioned_ids": [],
      "is_deleted": null
      "media": {
        "mimetype": "audio/wav",
        "filename": "beep.wav",
        "filedata": "data:audio/wav;base64,UklGRkKAAABXQVZFZm10IBAAAAABAAEAQB8A..."
      }
  }
  {
      "message_id": "true_2634e275-ac58-4c85-892d-83882810fc1c_api",
      "org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
      "ack": "3",
      "body": "Hello World",
      "from_me": true,
      "message_type": "chat",
      "chat_id": "918824248940@c.us",
      "timestamp": "2025-08-18T13:38:37.203+00:00",
      "org_phone": "918824248940@c.us",
      "performed_by": "api",
      "prev_body": null,
      "quoted_message_id": "52643136-1573-4011-ad22-b95ca6ea8e0c",
      "sender_phone": "918824248940@c.us",
      "sent_message_id": "2634e275-ac58-4c85-892d-83882810fc1c",
      "updated_at": "2025-08-18T13:38:37.203+00:00",
      "is_private_note": true,
      "unique_id": "2634e275-ac58-4c85-892d-83882810fc1c",
      "mentioned_ids": [],
      "is_deleted": null
      "media": {
        "mimetype": "audio/wav",
        "filename": "beep.wav",
        "filedata": "data:audio/wav;base64,UklGRkKAAABXQVZFZm10IBAAAAABAAEAQB8A..."
      }
  }
Refer Note object to find more details about note object.
import { PeriskopeApi } from '@periskope/periskope-client';

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

client.on('note.created', (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
}