Blog
Github
  1. Webhook
  • Getting Started
    • Introduction
    • Quickstart
    • Authentication
    • Status codes
  • Webhook
    • Webhook Setup
    • Webhook Events and Schema
  • API Reference
    • Contact
      • Listing
      • Create
      • Filter By SocialPlatformId
      • Form Fields
      • Detail
      • Update
      • Delete
      • Fetch Contact Groups
      • Update tags
    • Tag
      • Listing
    • Channel
      • Listing
      • Create
    • Ticket
      • Listing
      • Create
      • Filter by Contact ID
      • Form Fields
      • Update
      • Update status
    • Category
      • Listing
    • CxLog
      • Listing
    • Message
      • Send message
Blog
Github
  1. Webhook

Webhook Events and Schema

This page provides sample JSON payloads for all webhook events supported by the K-LINK Customer Support Platform. Use these schemas to understand the structure of incoming webhook requests and properly handle the data in your application.

Common Webhook Structure#

All webhook requests follow this basic structure:
{
  "event": "event.type",
  "timestamp": "2026-01-09T03:42:38.000000Z",
  "data": {
    // Event-specific data
  }
}

Common Fields#

FieldTypeDescription
eventStringType of event (e.g., contact.create, message.inbound)
timestampISO 8601When the event occurred in UTC
dataObjectEvent-specific payload data

Contact Events#

Contact Created#

Triggered when a new contact is added to your system.
Event Type: contact.create
{
  "event": "contact.create",
  "timestamp": "2026-01-09T03:42:38.000000Z",
  "data": {
    "id": "a0cad4e8-c23b-426d-95fe-75d02325d943",
    "name": "John",
    "address": "No.123, Sik Rd, Singapore",
    "channel": "whatsapp",
    "company": null,
    "companyId": null,
    "contactEmails": [
      {
        "id": "a0cad4e8-d357-42ae-aea2-0f628b826bd6",
        "email": "john@klink.cloud",
        "isPrimary": true,
        "createdAt": "2026-01-09T03:42:38.000000Z",
        "updatedAt": "2026-01-09T03:42:38.000000Z",
        "deletedAt": null
      }
    ],
    "contactPhones": [
      {
        "id": "a0cad4e8-da82-4d6b-b11c-bd3338c5e5b4",
        "phone": "06838387278",
        "isPrimary": true,
        "createdAt": "2026-01-09T03:42:38.000000Z",
        "updatedAt": "2026-01-09T03:42:38.000000Z",
        "deletedAt": null
      }
    ],
    "contactNumber": null,
    "contactProfile": null,
    "socialProfileUrl": null,
    "notes": null,
    "customFields": [],
    "tags": [
      {
        "id": "4f9cdf9d-ad8f-46d9-8e37-116b8741a7fb",
        "name": "VVIP",
        "position": 0,
        "createdAt": "2024-04-01T03:07:53.577170Z",
        "updatedAt": "2025-05-29T06:46:18.717607Z",
        "deletedAt": null
      }
    ],
    "platformContacts": [],
    "createdAt": "2026-01-09T03:42:38.000000Z",
    "updatedAt": "2026-01-09T03:42:38.000000Z",
    "deletedAt": null
  }
}

Contact Create - Field Reference#

FieldTypeDescription
idStringUnique contact identifier
nameStringContact name
addressStringPhysical address
channelStringPrimary communication channel
companyString/nullCompany name
companyIdString/nullAssociated company ID
contactEmailsArrayList of email addresses with id, email, isPrimary, timestamps
contactPhonesArrayList of phone numbers with id, phone, isPrimary, timestamps
contactNumberInteger/nullContact reference number
contactProfileString/nullProfile image URL
socialProfileUrlString/nullSocial media profile URL
notesString/nullInternal notes
customFieldsArrayCustom field values
tagsArrayAssigned tags with id, name, position, timestamps
platformContactsArrayPlatform-specific contact data
createdAtISO 8601Contact creation timestamp
updatedAtISO 8601Last modification timestamp
deletedAtISO 8601/nullSoft delete timestamp

Contact Updated#

Triggered when a contact's information is modified.
Event Type: contact.update
{
  "event": "contact.update",
  "timestamp": "2026-01-09T03:42:38.000000Z",
  "data": {
    "id": "a0cad4e8-c23b-426d-95fe-75d02325d943",
    "name": "John",
    "address": "No.123, Sik Rd, Singapore",
    "channel": "whatsapp",
    "company": null,
    "companyId": null,
    "contactEmails": [
      {
        "id": "a0cad4e8-d357-42ae-aea2-0f628b826bd6",
        "email": "john@klink.cloud",
        "isPrimary": true,
        "createdAt": "2026-01-09T03:42:38.000000Z",
        "updatedAt": "2026-01-09T03:42:38.000000Z",
        "deletedAt": null
      }
    ],
    "contactPhones": [
      {
        "id": "a0cad4e8-da82-4d6b-b11c-bd3338c5e5b4",
        "phone": "06838387278",
        "isPrimary": true,
        "createdAt": "2026-01-09T03:42:38.000000Z",
        "updatedAt": "2026-01-09T03:42:38.000000Z",
        "deletedAt": null
      }
    ],
    "contactNumber": 54432,
    "contactProfile": null,
    "socialProfileUrl": null,
    "notes": null,
    "customFields": [],
    "tags": [
      {
        "id": "4f9cdf9d-ad8f-46d9-8e37-116b8741a7fb",
        "name": "VVIP",
        "position": 0,
        "createdAt": "2024-04-01T03:07:53.577170Z",
        "updatedAt": "2025-05-29T06:46:18.717607Z",
        "deletedAt": null
      }
    ],
    "platformContacts": [],
    "createdAt": "2026-01-09T03:42:38.000000Z",
    "updatedAt": "2026-01-09T03:42:38.000000Z",
    "deletedAt": null
  }
}

Message Events#

Inbound Message Received#

Triggered when a new message is received from a customer.
Event Type: message.inbound
{
  "event": "message.inbound",
  "timestamp": "2026-01-09T07:05:42.378992489Z",
  "data": {
    "id": "706feaae-8e59-48c7-8784-33541e954c6b",
    "type": "text",
    "direction": "incoming",
    "message": "Hi there",
    "createdAt": "2026-01-09T07:05:33.027Z",
    "updatedAt": "2026-01-09T07:05:33.027Z",
    "editedAt": null,
    "isEdited": false,
    "platformMessageId": "m_doklox4t_bvRT60GJhQbji0VXumaYr7fHlifZ2Y4c5c-lSGsIQwFDjsNd5Uu8DaAyx2praGmIIa_zFwqswpEYQ",
    "platformId": "555104637677266",
    "roomId": "059e8ac4-50a5-4ecd-bb74-d63498ba709c",
    "senderId": null,
    "contactId": "9d15d54f-b876-445c-a6f7-ecf37cf1886b",
    "attachments": null,
    "readAt": null,
    "previewUrl": "",
    "locale": "",
    "template": null,
    "replyPlatformMessageId": null,
    "repliedMessage": null,
    "replyReaction": null,
    "metadata": {},
    "room": {
      "id": "059e8ac4-50a5-4ecd-bb74-d63498ba709c",
      "channelId": "4da39031-79b0-4fec-9800-4d9199ec82d5",
      "platformContactId": "7ea470eb-6e44-4f9d-aedd-e0330cb48235",
      "actorId": "8cde99fe-6054-4859-a104-d6a862afd811",
      "actor": {
        "id": "8cde99fe-6054-4859-a104-d6a862afd811",
        "name": "Hay Marn Sue",
        "email": "asue00630@gmail.com",
        "phone": "09980711651",
        "createdAt": "2023-11-17T09:12:08.801665Z",
        "updatedAt": "2025-12-24T09:16:25.826122Z",
        "deletedAt": null
      },
      "assigneeId": "8cde99fe-6054-4859-a104-d6a862afd811",
      "channel": {
        "id": "4da39031-79b0-4fec-9800-4d9199ec82d5",
        "name": "Testing Channel",
        "brandName": "Testing Channel",
        "type": "messenger",
        "platformId": "555104637677266",
        "status": true,
        "connectedUserId": "122131365806382390",
        "connectedUserName": "Jim Jim",
        "createdAt": "2025-12-15T05:55:14.275542Z",
        "updatedAt": "2025-12-15T05:55:14.275542Z",
        "deletedAt": null
      },
      "platformContact": [
        {
          "id": "7ea470eb-6e44-4f9d-aedd-e0330cb48235",
          "contactId": "9d15d54f-b876-445c-a6f7-ecf37cf1886b",
          "channelId": "4da39031-79b0-4fec-9800-4d9199ec82d5",
          "type": "messenger",
          "socialPlatformId": "25084025951204536",
          "metadata": {
            "id": "25084025951204536",
            "name": "John Hopper",
            "email": "",
            "profileUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?psid=25084025951204536",
            "socialPlatformId": "25084025951204536",
            "contactFolderName": "demo/profile"
          },
          "createdAt": "2025-12-18T03:59:07.599301Z",
          "updatedAt": "2025-12-18T03:59:07.599301Z",
          "deletedAt": null
        }
      ],
      "direction": "incoming",
      "status": 1,
      "isLatest": true,
      "isBotRoom": false,
      "isGroup": false,
      "createdAt": "2025-12-18T03:59:03.39Z",
      "updatedAt": "2026-01-09T07:05:33.027Z",
      "firstResponseAt": "2025-12-18T04:38:13Z",
      "firstResponseTime": 0,
      "firstRepliedAt": null,
      "firstRepliedTime": null,
      "lastMessage": "Hi there",
      "lastMessageAt": "2026-01-09T07:05:33.027Z",
      "unreadCount": 1,
      "closedAt": null,
      "metadata": {}
    },
    "deletedAt": null
  }
}

Inbound Message - Field Reference#

FieldTypeDescription
idStringUnique message identifier
typeStringMessage type (e.g., text, image, file)
directionStringincoming for inbound messages
messageStringMessage body content
createdAtISO 8601Message timestamp
updatedAtISO 8601Last modification timestamp
isEditedBooleanWhether message was edited
platformMessageIdStringPlatform-specific message ID
platformIdStringPlatform account/page ID
roomIdStringConversation room ID
senderIdString/nullID of the sender (null for incoming)
contactIdString/nullAssociated contact ID
attachmentsArray/nullFile attachments
readAtISO 8601/nullWhen message was read
metadataObjectPlatform-specific metadata and payload
roomObjectAssociated room/conversation data
deletedAtISO 8601/nullSoft delete timestamp

Outbound Message Sent#

Triggered when a message is sent to a customer.
Event Type: message.outbound
{
  "event": "message.outbound",
  "timestamp": "2026-01-09T07:07:38.128247406Z",
  "data": {
    "id": "c0ab2468-f630-4c75-9b8c-ba63df930b19",
    "type": "text",
    "direction": "outgoing",
    "message": "It is outbound message",
    "createdAt": "2026-01-09T07:07:34.699380286Z",
    "updatedAt": "2026-01-09T07:07:34.699380286Z",
    "editedAt": null,
    "isEdited": false,
    "platformMessageId": "m_ZDrWvRbfp_RwWyfAwc936S0VXumaYr7fHlifZ2Y4c5fYVVwxGqQYTwsZFdiZ6q4P2YIZxuB5Gr5395-X7jsZuA",
    "platformId": "555104637677266",
    "roomId": "059e8ac4-50a5-4ecd-bb74-d63498ba709c",
    "senderId": "d762a2be-ea27-49ff-b42c-03992953ab67",
    "contactId": "9d15d54f-b876-445c-a6f7-ecf37cf1886b",
    "attachments": null,
    "readAt": null,
    "previewUrl": "",
    "locale": "",
    "template": null,
    "replyPlatformMessageId": null,
    "repliedMessage": null,
    "replyReaction": null,
    "metadata": {},
    "room": {
      "id": "059e8ac4-50a5-4ecd-bb74-d63498ba709c",
      "channelId": "4da39031-79b0-4fec-9800-4d9199ec82d5",
      "platformContactId": "7ea470eb-6e44-4f9d-aedd-e0330cb48235",
      "actorId": "d762a2be-ea27-49ff-b42c-03992953ab67",
      "actor": {
        "id": "d762a2be-ea27-49ff-b42c-03992953ab67",
        "name": "John Hopper",
        "email": "johnhopper@gmail.co",
        "phone": "",
        "createdAt": "2023-11-22T18:40:10.632745Z",
        "updatedAt": "2025-05-01T04:04:12.691716Z",
        "deletedAt": null
      },
      "assigneeId": "d762a2be-ea27-49ff-b42c-03992953ab67",
      "assignee": {
        "id": "d762a2be-ea27-49ff-b42c-03992953ab67",
        "name": "John Hopper",
        "email": "johnhopper@gmail.co",
        "phone": "",
        "createdAt": "2023-11-22T18:40:10.632745Z",
        "updatedAt": "2025-05-01T04:04:12.691716Z",
        "deletedAt": null
      },
      "channel": {
        "id": "4da39031-79b0-4fec-9800-4d9199ec82d5",
        "name": "Testing Channel",
        "brandName": "Testing Channel",
        "type": "messenger",
        "platformId": "555104637677266",
        "status": true,
        "connectedUserId": "122131365806382390",
        "connectedUserName": "Jim Jim",
        "createdAt": "2025-12-15T05:55:14.275542Z",
        "updatedAt": "2025-12-15T05:55:14.275542Z",
        "deletedAt": null
      },
      "platformContact": [
        {
          "id": "7ea470eb-6e44-4f9d-aedd-e0330cb48235",
          "contactId": "9d15d54f-b876-445c-a6f7-ecf37cf1886b",
          "channelId": "4da39031-79b0-4fec-9800-4d9199ec82d5",
          "type": "messenger",
          "socialPlatformId": "25084025951204536",
          "metadata": {
            "id": "25084025951204536",
            "name": "John Hopper",
            "email": "",
            "profileUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?psid=25084025951204536",
            "socialPlatformId": "25084025951204536",
            "contactFolderName": "demo/profile"
          },
          "createdAt": "2025-12-18T03:59:07.599301Z",
          "updatedAt": "2025-12-18T03:59:07.599301Z",
          "deletedAt": null
        }
      ],
      "cxLog": {
        "id": "313111f6-3c40-4a01-b9ca-be56f4cd265f",
        "caseId": 13315,
        "channel": "messenger",
        "direction": "inbound",
        "contactId": "9d15d54f-b876-445c-a6f7-ecf37cf1886b",
        "agentId": "d762a2be-ea27-49ff-b42c-03992953ab67",
        "firstAssigneeId": "8cde99fe-6054-4859-a104-d6a862afd811",
        "entityName": "room",
        "entityId": "059e8ac4-50a5-4ecd-bb74-d63498ba709c",
        "startedDate": "2025-12-18T03:59:03.39Z",
        "firstResponseTime": 0,
        "firstRepliedTime": null,
        "createdAt": "2025-12-18T03:59:08.628432Z",
        "updatedAt": "2026-01-09T07:07:18Z",
        "wrapUpFormId": "f71c0570-f92e-426e-9017-6c64cb75bc0b",
        "deletedAt": null
      },
      "direction": "incoming",
      "status": 1,
      "isLatest": true,
      "isBotRoom": false,
      "isGroup": false,
      "createdAt": "2025-12-18T03:59:03.39Z",
      "updatedAt": "2026-01-09T07:07:34.69938Z",
      "firstResponseAt": "2025-12-18T04:38:13Z",
      "firstResponseTime": 0,
      "firstRepliedAt": "2026-01-09T07:07:37.085254Z",
      "firstRepliedTime": 1912113,
      "lastMessage": "It is outbound message",
      "lastMessageAt": "2026-01-09T07:05:33.027Z",
      "unreadCount": 0,
      "closedAt": null,
      "metadata": {}
    },
    "deletedAt": null
  }
}

Outbound Message - Field Reference#

FieldTypeDescription
idStringUnique message identifier
typeStringMessage type (e.g., text, image, file)
directionStringoutgoing for outbound messages
messageStringMessage body content
createdAtISO 8601Message timestamp
updatedAtISO 8601Last modification timestamp
isEditedBooleanWhether message was edited
platformMessageIdStringPlatform-specific message ID
platformIdStringPlatform account/page ID
roomIdStringConversation room ID
senderIdStringID of the agent/user who sent the message
contactIdStringAssociated contact ID
attachmentsArray/nullFile attachments
readAtISO 8601/nullWhen message was read by recipient
metadataObjectCustom metadata (can be empty)
replyPlatformMessageIdString/nullID of replied message on platform
repliedMessageObject/nullReplied message content
replyReactionString/nullReaction to message
roomObjectAssociated room/conversation data with metrics and cxLog
deletedAtISO 8601/nullSoft delete timestamp

Room Object Reference#

The room object contains conversation context and appears in message events:
FieldTypeDescription
idStringUnique room/conversation ID
channelIdStringAssociated channel ID
platformContactIdStringPlatform contact identifier
assigneeIdString/nullAssigned agent/user ID
directionStringincoming or outgoing
statusIntegerRoom status (1 = active)
isLatestBooleanWhether this is the latest conversation
createdAtISO 8601Conversation creation timestamp
updatedAtISO 8601Last activity timestamp
firstRepliedAtISO 8601/nullWhen first response was sent
firstRepliedTimeIntegerMilliseconds to first reply
firstResponseAtISO 8601/nullWhen first message was received
firstResponseTimeIntegerMilliseconds to first response
lastMessageStringLast message text
lastMessageAtISO 8601Timestamp of last message
unreadCountIntegerNumber of unread messages

Email Object Reference#

Appears in the contactEmails array:
FieldTypeDescription
idStringUnique email ID
emailStringEmail address
isPrimaryBooleanPrimary email flag
createdAtISO 8601Creation timestamp
updatedAtISO 8601Last modification timestamp
deletedAtISO 8601/nullSoft delete timestamp

Phone Object Reference#

Appears in the contactPhones array:
FieldTypeDescription
idStringUnique phone ID
phoneStringPhone number
isPrimaryBooleanPrimary phone flag
createdAtISO 8601Creation timestamp
updatedAtISO 8601Last modification timestamp
deletedAtISO 8601/nullSoft delete timestamp

Tag Object Reference#

Appears in the tags array:
FieldTypeDescription
idStringUnique tag ID
nameStringTag name
positionIntegerDisplay position/order
createdAtISO 8601Creation timestamp
updatedAtISO 8601Last modification timestamp
deletedAtISO 8601/nullSoft delete timestamp

Best Practices for Handling Payloads#

1.
Validate Signature: Always verify webhook signatures before processing payload data
2.
Handle Null Values: Optional fields may be null; use defensive programming
3.
Parse Timestamps: All timestamps are in ISO 8601 format with UTC timezone
4.
Store Event IDs: Track processed message IDs to avoid duplicate processing
5.
Idempotency: Use clientRequestId for outbound messages to detect retries
6.
Room Context: Use room object data for conversation metrics and status
7.
Custom Fields: The customFields array structure depends on your workspace configuration
8.
Metadata: Platform-specific data is nested in the metadata object; parse based on channel type

Testing with Sample Data#

To test your webhook handler without live events, you can:
1.
Copy the sample payloads above
2.
Test your signature verification with these payloads
3.
Ensure your endpoint correctly parses and processes the data
4.
Verify error handling for edge cases
5.
Validate timestamp parsing and timezone handling
For more information about webhook setup, refer to the Webhook Setup Documentation.
Modified at 2026-01-09 07:12:45
Previous
Webhook Setup
Next
Listing
Built with