Message Archiving via Webhook

Message Archiving via Webhook

This guide explains how to configure and use the YakChat Message Webhook for archiving purposes, including setup, payload structure, and best practices.

How Message Archiving via Webhook Works

The YakChat Webhook sends every message event in real time to your configured system for archiving, compliance, or analytics.

  • Every inbound or outbound message generates a webhook event.
  • Each event includes metadata such as sender, recipient, timestamp, and message content.
  • Your endpoint receives the JSON payload and stores it in your archiving system.
  • Each webhook call represents a single message record for retention or compliance.
Configuring the Webhook
Each YakChat customer can configure their own webhook destination URL within the YakChat Portal. This allows organizations to send message data directly to their preferred endpoint — for example:
  1. A secure archiving or compliance platform 
  2. A CRM, analytics system, or internal database 
  3. A middleware or message bus for further processing
Step 1: Configure Webhook URL
  1. Sign in to the YakChat Portal.
  2. Navigate to the Integration page and select Webhook.
  3. Enter your Webhook Destination URL , set the Status to Active and save.

Step 2: Prepare Your Endpoint

  1. Ensure the endpoint accepts HTTPS POST requests.
  2. Ensure it accepts application/json payloads.
  3. Return an HTTP 200 OK response to confirm receipt.
  4. Allowlist the Webhook Source IP 52.230.236.3 to validate the request origin
Example Webhook Payload
HTTP Method
POST
Content-Type
application/json
Example Payload
{
"RoomId": "1088004",
"MessageId": "49994367",
"Text": "YakChat test message",
"Direction": "outbound",
"From": "+1xxxxxxxxxx",
"To": ["+1xxxxxxxxxx"],
"MediaURLs": [],
"CompanyId": "2",
"Timestamp": "2025-10-14T01:44:40Z",
"AccountReference": "this-is-account-reference-from-portal",
"InboxType": "Personal",
"Channel": "SMS",
"InboxNumber": "+1xxxxxxxxxx",
"Members": ["user@company.org"]
}
Webhook Fields Reference
 
FieldTypeDescription
RoomIdstringUnique identifier for the conversation or chat room.
MessageIdstringUnique identifier for the message.
TextstringMessage body text (may be empty for media-only messages).
DirectionstringIndicates inbound (received) or outbound (sent).
FromstringSender’s phone number in E.164 format.
Toarray[string]List of recipient phone numbers.
MediaURLsarray[string]URLs of attached media files.
CompanyIdstringIdentifier of the organization in YakChat.
TimestampstringUTC timestamp of the message (ISO 8601).
AccountReferencestringReference used for mapping to external systems.
InboxTypestringType of inbox (Personal or Shared).
ChannelstringMessaging channel (SMS, MMS, RCS, WhatsApp).
InboxNumberstringBusiness or YakChat number used.
Membersarray[string]Users with access to the conversation.
Usage Notes
  • Message Types: The Channel field indicates the communication type. Payloads for MMS, RCS, or WhatsApp may include additional media URLs or structured content in future revisions.
  • Archiving: Each webhook call represents a discrete message record and can be stored for compliance or analytics purposes.
  • Retries: If your endpoint fails to respond with HTTP 200, YakChat may retry delivery (depending on your account configuration).
  • Security: YakChat recommends validating the request origin via IP allowlisting.