Skip to main content

Scenario

Segment sends events in real time to destinations — including webhooks. You configure a Segment webhook destination to send specific events (like trial_started, plan_upgraded, feature_milestone) to your server, which automatically creates or updates a Mavera persona or triggers a Mave research query. The result is research that triggers in real time when user behavior changes, not on a batch schedule.

Architecture

Code

Example Output

Error Handling

In Segment, add a Webhook destination: Destinations → Add Destination → Webhooks → Configure. Set the URL to your server’s public endpoint. Enable the specific events you want to trigger on.
Segment webhook destinations support shared secrets. Add a x-segment-secret header check in your handler to verify requests originate from Segment.
Segment may retry failed webhook deliveries. Use the messageId field to deduplicate — store processed message IDs and skip duplicates to avoid creating duplicate personas.
The webhook server needs a public URL. For development, use ngrok, cloudflare tunnel, or deploy to a serverless platform (AWS Lambda, Vercel, etc.).

What’s Next

Segment Integration

Back to Segment integration overview

Profile Traits → Custom Persona Source

Create trait-enriched personas from computed traits

Cross-Source Unified Persona

Build unified cross-channel personas

Mave Agent

Full reference for POST /api/v1/mave/chat