SupportThreadMiChamba · WhatsApp ⇄ HubSpot
Jackson Shuey
WhatsApp inbound
customer · Spanish · Cloud API
media + voice
image · audio · document
agent reply
HubSpot · English
verify_webhook
HMAC-SHA256 · whatsapp/webhook.ts
normalize_message
whatsapp/normalize.ts
on_agent_reply
hubspot/outbound.ts
gpt-4o · translate
detect + es ⇄ en
gpt-4o · triage
category · priority · intent
bridge
engine/bridge.ts · idempotent
SupportThread
canonical conversation
wa ⇄ ticket2 languagesstatusbilingual log
upsert_contact
HubSpot CRM · by phone
open_or_update_ticket
Service Hub · support ticket
append_message
original + translation
send_whatsapp_reply
translated · Cloud API
sla_timer
first-response watch
write_sync_log
append-only · idempotency keys
HubSpot Service Hub
agent inbox · tickets
Customer · WhatsApp
reply in Spanish
Sample data · one WhatsApp thread, end to endSpanish in · English ticket out · Spanish reply back
{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "102290129340398",
      "changes": [
        {
          "field": "messages",
          "value": {
            "messaging_product": "whatsapp",
            "metadata": {
              "display_phone_number": "5215500010002",
              "phone_number_id": "106540352242922"
            },
            "contacts": [
              {
                "profile": { "name": "María Fernanda Ruiz" },
                "wa_id": "5215512345678"
              }
            ],
            "messages": [
              {
                "from": "5215512345678",
                "id": "wamid.HBgNNTIxNTUxMjM0NTY3OBUCABIYE...",
                "timestamp": "1781276400",
                "type": "text",
                "text": {
                  "body": "Hola, llevo dos días sin poder acceder a mi cuenta y tengo un pago pendiente. ¿Me pueden ayudar por favor?"
                }
              }
            ]
          }
        }
      ]
    }
  ]
}
{
  "threadId": "thr_5215512345678",
  "direction": "inbound",
  "channel": "whatsapp",
  "waMessageId": "wamid.HBgNNTIxNTUxMjM0NTY3OBUCABIYE...",
  "contact": {
    "waId": "5215512345678",
    "name": "María Fernanda Ruiz",
    "phone": "+5215512345678"
  },
  "receivedAt": "2026-06-12T15:00:00.000Z",
  "language": { "detected": "es", "confidence": 0.99 },
  "body": {
    "original": "Hola, llevo dos días sin poder acceder a mi cuenta y tengo un pago pendiente. ¿Me pueden ayudar por favor?",
    "translated": "Hi, I haven't been able to access my account for two days and I have a pending payment. Can you help me, please?",
    "targetLang": "en"
  },
  "triage": {
    "category": "account_access",
    "priority": "HIGH",
    "intent": "request_support",
    "sentiment": "frustrated"
  }
}
{
  "contact": {
    "id": "151243001",
    "properties": {
      "firstname": "María Fernanda",
      "lastname": "Ruiz",
      "phone": "+5215512345678",
      "hs_whatsapp_phone_number": "+5215512345678",
      "hs_language": "es"
    }
  },
  "ticket": {
    "id": "284410072",
    "properties": {
      "subject": "[WhatsApp] account access issue · María Fernanda Ruiz",
      "content": "Customer (es) cannot access their account and has a pending payment.",
      "hs_pipeline": "0",
      "hs_pipeline_stage": "1",
      "hs_ticket_priority": "HIGH",
      "source_type": "WHATSAPP",
      "michamba_customer_language": "es"
    },
    "associations": ["contact:151243001"]
  },
  "thread": [
    {
      "engagementId": "eng_990001",
      "direction": "incoming",
      "from": "+5215512345678",
      "lang": "es",
      "original": "Hola, llevo dos días sin poder acceder a mi cuenta...",
      "translated": "Hi, I haven't been able to access my account...",
      "timestamp": "2026-06-12T15:00:00Z"
    }
  ]
}
{
  "thread_id": "thr_5215512345678",
  "status": "waiting_on_customer",
  "customer_language": "es",
  "agent_language": "en",
  "whatsapp": {
    "wa_id": "5215512345678",
    "phone_number_id": "106540352242922",
    "contact_name": "María Fernanda Ruiz"
  },
  "hubspot": {
    "contact_id": "151243001",
    "ticket_id": "284410072",
    "pipeline_stage": "waiting_on_customer",
    "priority": "HIGH"
  },
  "messages": [
    {
      "seq": 1,
      "direction": "inbound",
      "lang": "es",
      "original": "Hola, llevo dos días sin poder acceder a mi cuenta y tengo un pago pendiente. ¿Me pueden ayudar por favor?",
      "translated_en": "Hi, I haven't been able to access my account for two days and I have a pending payment. Can you help me, please?",
      "at": "2026-06-12T15:00:00Z"
    },
    {
      "seq": 2,
      "direction": "outbound",
      "lang": "en",
      "original": "Hi María, sorry for the trouble. I've reset your account access, please try logging in again.",
      "translated_es": "Hola María, lamento las molestias. Restablecí el acceso a tu cuenta, intenta iniciar sesión de nuevo.",
      "at": "2026-06-12T15:04:00Z"
    }
  ],
  "first_response_due": "2026-06-12T15:30:00Z",
  "last_synced_at": "2026-06-12T15:04:03Z"
}

All synthetic. The bridge maps a Meta Cloud API webhook into one canonical SupportThread, opens a HubSpot ticket, and sends the agent’s English reply back to the customer translated into Spanish. The thread_id keeps a replayed webhook from ever double-posting.

EntitySupportThread · MiChamba
OwnerJ. ShueyUpdated2026-06-12
ChannelsWhatsApp ⇄ HubSpotRevA