Skip to content

Bridge service

The node service that wires Polly to the rest of the world.

Location

  • Host: 72.62.112.155 (Hostinger VPS)
  • Path on host: /opt/yourevenings/bridge
  • Container: yourevenings-bridge (Docker, host networking, port 8765)
  • Public URL: https://bridge.yourevenings.com (Traefik → Let's Encrypt cert)
  • Repo (local): /data/.openclaw/workspace/ventures/yourevenings/bridge

Health

  • GET / → currently returns 404 (acceptable — no homepage). HEARTBEAT.md rule: only 000 or 5xx is a fail.
  • GET /health → 200 with JSON status.

Key routes

Route Purpose
GET /health Liveness probe
POST /twiml/outbound Twilio voice webhook (legacy US flow)
WS /audio/:callSid Twilio Media Streams ↔ voice agent (legacy)
POST /api/call Internal: place outbound call (auth via INTERNAL_API_KEY)
POST /api/cal-webhook Cal.com booking → schedule Polly call
POST /api/audit-callback call-me-now form → outbound audit-callback mode
GET /lead-flow Renders mermaid lead-flow diagram (source of truth: src/lead-flow.js)
POST /api/approve-report/:callSid One-click approve audit-report send (email link)
POST /api/hold-report/:callSid One-click hold audit-report send (email link)
POST /api/provision-pilot/queue Apps Script enqueues a pilot for approval
GET /api/provision-pilot/approve/:id Matt's one-click approve link → runs full provisioning
GET /api/provision-pilot/reject/:id Matt's one-click reject link
GET /api/provision-pilot/status/:id Apps Script polls for state
GET /api/provision-pilot/queue HTML dashboard of all pilot records

Pilot provisioning (Phase 2, 2026-06-21)

The /api/provision-pilot/* endpoints automate Polly UK pilot setup. When Matt approves a queued row:

  1. Buys a UK Twilio mobile number (reusing the approved regulatory bundle TWILIO_UK_BUNDLE_SID)
  2. Clones the Polly UK Trades v2 assistant (VAPI_BASE_ASSISTANT_ID) with this pilot's tokens baked into the system prompt + first message
  3. Binds the new Twilio number to the cloned assistant via Vapi
  4. SMSes the trade their 3 forwarding codes from the new YE number

Each step is idempotent + per-step persisted to /data/provisions.json — partial failures can be retried by clicking Approve again.

Auth: same INTERNAL_API_KEY as audit-report endpoints (x-api-key on POST, ?key= on GET).

Katie triggers it from the Call Log Sheet via the 🚀 YE Provision menu.

Handoff: SMS + Email

End of every Polly call → bridge sends:

  • SMS via Twilio (env: TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_PHONE_NUMBER)
  • Email via Zoho SMTP (env: SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS)
  • Fallback recipient: FALLBACK_AUDIT_EMAIL (Matt's inbox during pilot phase)

Restart / redeploy

From workspace:

ssh root@72.62.112.155
cd /opt/yourevenings/bridge
docker compose pull && docker compose up -d --force-recreate
docker logs -f yourevenings-bridge

(Don't restart without need — service is steady.)

Known transient

  • Vapi calls occasionally time out — bridge logs them as skipped (silent in monitoring). Not a real outage.