PuddlePuddle Docs
Inbox

Custom channels

Bring messages from anywhere into the Inbox, and send your replies back.

A custom channel connects the Inbox to something Puddle doesn't support itself: an SMS gateway, a marketplace's messages, your own app. Your server posts customers' messages to Puddle, and your team's replies come back to your server as webhooks.

Set it up

  1. In Settings → Inbox, under Custom channels, name the channel (e.g. "SMS") and click Add channel. Note its id.
  2. In Settings → Developers, create a secret API key with the inbox:write scope (and inbox:read to fetch replies).
  3. Add a webhook endpoint for inbox.message.created.

Send a customer's message to the Inbox

curl -X POST https://api.puddle.co.za/v1/inbox/channels/CHANNEL_ID/messages \
  -H "Authorization: Bearer psk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "from": { "kind": "PHONE", "value": "+27821234567", "name": "Thandi" },
    "text": "Hi, is the blue mug back in stock?",
    "externalMessageId": "sms-48213"
  }'
FieldWhat it is
from.kindEXTERNAL (your own user id), EMAIL or PHONE
from.valueThe id, email address or phone number. Messages from the same value thread into the same conversation
from.name, from.emailOptional details shown in the Inbox
textThe message, up to 10,000 characters
externalMessageIdYour id for the message. Sending it again does nothing, so retries are safe
externalThreadIdOptional: your id for the conversation, if your system has threads

The response has the conversationId and messageId, and duplicate: true when the message was already stored.

People who reach you through a custom channel are contacts like everyone else, but what your server says about them isn't treated as verified, so they aren't joined to other contacts automatically.

Send replies back

When your team replies, Puddle sends inbox.message.created to your webhook with "channelType": "CUSTOM", "direction": "OUTBOUND" and "kind": "MESSAGE". Ignore everything else (internal notes have "kind": "NOTE", and customers' own messages are INBOUND).

The webhook carries ids, not the text. Fetch the conversation's latest messages and take the one with the webhook's messageId:

curl "https://api.puddle.co.za/v1/inbox/conversations/CONVERSATION_ID/messages?limit=10" \
  -H "Authorization: Bearer psk_..."

If you have more than one custom channel, GET /inbox/conversations/{id} tells you which one (channel.id), so you send the reply the right way.

On this page