Messages Webhooks

This guide explains how to receive real-time notifications about guest and host messages on the Plum Guide platform.

Overview

Webhooks let you know the moment a guest writes to a host, so you do not have to poll for new messages. An approved software partner also learns when the host sends the guest a message. Plum calls your endpoint with the ids of the conversation and the message. You then fetch the text through the messaging API.

The callback carries no message text. That keeps guest content out of your logs and out of anything that inspects the request on its way to you.



Quick Start

1. Configure Messages Webhook Endpoint

POST /v2/webhooks/config
Authorization: Bearer {your_token}
Content-Type: application/json

{
  "isActive": true,
  "endpoints": {
    "messages": "https://your-domain.com/webhooks/messages"
  }
}

The response includes a signingSecret. It is returned only on create and on rotation, so store it now. Every webhook carries the header X-Signature: sha256=<hex>, the HMAC-SHA256 of the raw body keyed with this secret. See Bookings Webhooks for how to check it.

2. Receive Message Events

When a guest sends a message, your endpoint receives:

{
  "EventId": "506f6996-2445-499a-abe9-2ca1e1feebcf",
  "Timestamp": "2026-08-24T10:15:24.5949004Z",
  "BookingCode": null,
  "ListingId": 7,
  "EventType": "GuestMessageReceived",
  "ConversationId": 23722,
  "MessageId": 325924
}

Every event also has HostId: the host the event is for. A software partner that acts for many hosts sends it in X-Plum-Host-Id to fetch the message. See Connecting many hosts.

3. Fetch the Message

Use the conversation id to read the thread:

GET /v2/messaging/conversations/23722/messages
Authorization: Bearer {your_token}

Message Events

EventDescriptionAction Required
Guest Message ReceivedA guest sent a message to the hostFetch the thread and reply if needed
Host Message SentThe host sent the guest a message, from the Plum Guide dashboard or through the API. Software partners onlySkip it if you sent the message yourself. Otherwise fetch the thread

HostMessageSent goes only to the Messages webhook of an approved software partner. A host's own webhook never receives it, so a host gets GuestMessageReceived only.

The partner also gets HostMessageSent for the messages it sent itself through the API. Keep the messageId that each of your send calls returns, and skip the events whose MessageId matches one of them.


Webhook Payload

{
  "EventId": "506f6996-2445-499a-abe9-2ca1e1feebcf",
  "Timestamp": "2026-08-24T10:15:24.5949004Z",
  "BookingCode": null,
  "ListingId": 7,
  "EventType": "GuestMessageReceived",
  "ConversationId": 23722,
  "MessageId": 325924
}
FieldTypeDescription
EventIdUUIDUnique identifier for this event (use for idempotency)
TimestampdateTimeWhen we sent the event, in UTC
BookingCodenullAlways null for message events
ListingIdintegerThe listing the conversation is about
EventTypestringGuestMessageReceived when the guest wrote, or HostMessageSent when the host sent the guest a message
ConversationIdintegerThe conversation the message belongs to
MessageIdintegerThe message that was sent

Field names are in PascalCase, unlike the rest of the API. Every field is always present, even when it is null.

EventType distinguishes message events from the booking and listing channels, which share the same payload shape. Treat any value you do not recognize as one to ignore rather than one to reject, so a future event type does not break your handler.


Configuration API

Create Configuration

POST /v2/webhooks/config
Content-Type: application/json
Authorization: Bearer {token}

{
  "isActive": true,
  "endpoints": {
    "messages": "https://your-domain.com/webhooks/messages"
  }
}

POST creates. If a configuration already exists it returns 400 with "Webhook configuration already exists. Use PUT to update." — it does not overwrite.

Update Configuration

PUT /v2/webhooks/config
Content-Type: application/json
Authorization: Bearer {token}

{
  "isActive": true,
  "endpoints": {
    "bookings": "https://your-domain.com/webhooks/bookings",
    "listings": "https://your-domain.com/webhooks/listings",
    "messages": "https://your-domain.com/webhooks/messages"
  }
}

Get Configuration

GET /v2/webhooks/config
Authorization: Bearer {token}

The signing secret is never returned here. Only create and rotation return it.

Toggle On/Off

PATCH /v2/webhooks/config/toggle?isActive=false
Authorization: Bearer {token}

isActive is required — omitting it returns 400, and it sets the state rather than flipping it.

Delete Configuration

DELETE /v2/webhooks/config
Authorization: Bearer {token}
🚧

Note: PUT is the only way to change an existing configuration, and it replaces the whole thing. Any channel you leave out of the body is cleared, so a PUT carrying only bookings silently removes your messages endpoint. Always send every endpoint you want to keep — read the current configuration first if you are unsure. An endpoint cannot be cleared by sending an empty string, which is rejected as an invalid URL; omit it instead.

Requirements:

  • Endpoint URL must use HTTPS
  • Your endpoint must return 200 OK within 30 seconds

Handling Message Events

Guest Message Received

Acknowledge first, then fetch the thread:

app.post('/webhooks/messages', async (req, res) => {
  res.status(200).send('OK');

  const { ConversationId: conversationId } = req.body;
  const { data: messages } = await plumApi.getMessages(conversationId);

  const latest = messages[messages.length - 1];
  if (latest.sender === 'Guest') {
    await notifyHostOfNewMessage(conversationId, latest.body);
  }
});

Messages come back newest first, so the one that just arrived is the first entry. Matching on MessageId from the payload is steadier than relying on position, and it is what the fuller example below does.


Complete Example Handler

const processedEvents = new Set();
const sentByUs = new Set(); // messageId of each message you sent through the API

app.post('/webhooks/messages', async (req, res) => {
  const { EventId: eventId, EventType: eventType, ConversationId: conversationId, MessageId: messageId } = req.body;

  // Ignore event types we do not handle yet
  if (eventType !== 'GuestMessageReceived' && eventType !== 'HostMessageSent') {
    return res.status(200).send('Ignored');
  }

  // Skip the messages you sent yourself through the API
  if (eventType === 'HostMessageSent' && sentByUs.has(messageId)) {
    return res.status(200).send('Own message');
  }

  // Idempotency check
  if (processedEvents.has(eventId)) {
    return res.status(200).send('Already processed');
  }

  // Acknowledge receipt immediately
  res.status(200).send('OK');
  processedEvents.add(eventId);

  try {
    const { data: messages } = await plumApi.getMessages(conversationId);
    const message = messages.find(m => m.messageId === messageId);

    await deliverToHostInbox(conversationId, message);
  } catch (error) {
    console.error('Failed to process message webhook:', error);
  }
});

Best Practices

  1. Respond quickly - Return 200 OK immediately, process asynchronously
  2. Implement idempotency - Use EventId to avoid processing duplicates
  3. Fetch the text - The payload carries ids only, never message content
  4. Ignore unknown EventType values - Return 200 so new event types do not break you
  5. Skip your own messages - Only an approved software partner gets HostMessageSent. Skip the events whose MessageId your own send call returned

Troubleshooting

Not receiving webhooks?

  1. Verify configuration: GET /v2/webhooks/config
  2. Check isActive is true
  3. Ensure endpoints.messages is set — and that an earlier PUT did not clear it
  4. Confirm URL is HTTPS and publicly accessible
  5. Confirm you are expecting a guest message. Host messages fire only for an approved software partner

Receiving duplicates?

This is expected: we retry when your endpoint does not answer with a 2xx status. Use EventId for deduplication:

const processedEvents = new Set();

if (processedEvents.has(eventId)) {
  return res.status(200).send('Already processed');
}
processedEvents.add(eventId);

Duplicates also arrive when your endpoint answers with a non-2xx or times out, because the delivery is retried.

Events stop arriving after an outage

A delivery that keeps failing is retried a limited number of times and then given up on. Once your endpoint is healthy again, use GET /v2/messaging/activities?fromDate=... to catch up on anything missed while it was down.


Testing Checklist

  • Endpoint returns 200 OK within 30 seconds

  • Handles duplicate events (same EventId)

  • Ignores unrecognized EventType values with a 200

  • Fetches message text via the messaging API

  • Catches up through the activity feed after downtime