Skip to content

Document Entrance Group webhook payload and add incoming message support #69

@nafg

Description

@nafg

Context

The sms-registration project receives incoming SMS messages via Entrance Group webhooks. Currently, only the message and number fields are parsed from the webhook payload. The full payload contains much richer data that could be leveraged.

Entrance Group Webhook Payload

Here is the actual payload received from an Entrance Group webhook (POST to /ingest/entrance-group):

{
  "eventType": "newMessage",
  "channel_id": 31002629,
  "ts": "Sun, 01 Feb 2026 23:23:32 GMT",
  "message": "hi",
  "workspace_id": "2181",
  "assigned_to": 4540,
  "number": "17325342893",
  "from": "17325079711",
  "campaign_id": "919501",
  "stop_filter": false,
  "stop": false,
  "payload": {
    "webhook_record_sent_at": "2026-02-01T23:23:32.072Z",
    "id": 90218076,
    "channel_id": 31002629,
    "ts": "Sun, 01 Feb 2026 23:23:32 GMT",
    "message": "hi",
    "workspace_id": "2181",
    "assigned_to": 4540,
    "number": "17325342893",
    "from": "17325079711",
    "campaign_id": "919501",
    "stop_filter": false,
    "stop": false,
    "contact": {
      "id": 294002507,
      "guide": "2181-17325342893",
      "number": "17325342893",
      "stop": false,
      "routable": false,
      "meta": {
        "message": "..."
      }
    },
    "uuid": "f1022265-8aba-48c7-a6a1-7f1d8cbe89bc",
    "webhook_url": "https://app-280358789919.us-east4.run.app/ingest/entrance-group"
  }
}

Key fields

  • channel_id — The conversation channel. This is what should be used to send replies, rather than creating a new campaign per message (which is what we currently do).
  • number — The sender's phone number (no + prefix, e.g., "17325342893" not "+17325342893")
  • from — The Entrance Group number (the "from" number on their side)
  • message — The SMS text content
  • stop / stop_filter — Opt-out status, could be used for handling STOP messages
  • contact — Contact metadata including a guide identifier and meta data

Proposal

Add support for parsing and modeling the Entrance Group incoming webhook payload in zio-messaging. This would include:

  1. A data model (case class) for the full webhook payload
  2. A data model for the nested contact and payload objects
  3. Parsing/deserialization support (the payload is JSON, sent as POST body with Content-Type: application/json from axios/0.21.4)

This is a prerequisite for sending replies via channel_id instead of creating new campaigns (see related issue about channel-based messaging).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions