Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mavera.io/llms.txt

Use this file to discover all available pages before exploring further.

Scenario

Your lead scoring model assigns hot/warm/cold tiers — but does the scoring actually predict engagement? This job pulls scored leads from each tier, creates a persona per score bucket, then runs a focus group asking “Would you respond to this outreach?” with your real email templates as stimulus. The output validates whether your scoring model aligns with buyer reality.

Architecture

Code

import os, requests

SF   = os.environ["SALESFORCE_INSTANCE"]
SF_T = os.environ["SALESFORCE_ACCESS_TOKEN"]
MV_K = os.environ["MAVERA_API_KEY"]
SF_H = {"Authorization": f"Bearer {SF_T}"}
MV_H = {"Authorization": f"Bearer {MV_K}", "Content-Type": "application/json"}

TIERS = {"hot": "Rating = 'Hot'", "warm": "Rating = 'Warm'", "cold": "Rating = 'Cold'"}
EMAIL_TEMPLATE = (
    "Subject: Quick call this week?\n\n"
    "Hi {{Name}}, given your team's growth, I'd love 15 minutes to show "
    "how we've helped similar companies cut onboarding time by 40%."
)

persona_ids = []
for tier, where in TIERS.items():
    leads = requests.get(
        f"https://{SF}/services/data/v66.0/query", headers=SF_H,
        params={"q": f"SELECT Name, Title, Company, Industry FROM Lead WHERE {where} LIMIT 20"},
    ).json()["records"]

    titles = [l.get("Title", "Manager") for l in leads]
    top = max(set(titles), key=titles.count) if titles else "Manager"

    p = requests.post(
        "https://app.mavera.io/api/v1/personas", headers=MV_H,
        json={
            "name": f"{tier.title()} Lead — {top}",
            "description": f"'{tier}' scored leads. Typical role: {top}. Based on {len(leads)} leads.",
        },
    ).json()
    persona_ids.append(p["id"])

fg = requests.post(
    "https://app.mavera.io/api/v1/focus-groups", headers=MV_H,
    json={
        "persona_ids": persona_ids,
        "questions": [
            {"type": "nps", "text": "You receive this email. How likely are you to respond (0-10)?"},
            {"type": "open_ended", "text": f"Here is the outreach email:\n\n{EMAIL_TEMPLATE}\n\nWould you open, reply, or ignore? Why?"},
            {"type": "open_ended", "text": "What would make you more likely to engage with cold outreach?"},
            {"type": "open_ended", "text": "Describe the last vendor email you actually replied to. What stood out?"},
        ],
    },
).json()

print(f"Focus Group: {fg['id']}")
for r in fg.get("responses", []):
    print(f"\n[{r['persona_name']}] Q: {r['question'][:60]}...")
    print(f"  A: {r['response']}")

Example Output

{
  "id": "fg_9wT2r",
  "summary": { "hot_nps_avg": 8.2, "warm_nps_avg": 5.4, "cold_nps_avg": 2.1 },
  "responses": [
    {
      "persona_name": "Hot Lead — VP Engineering",
      "question": "Would you open, reply, or ignore? Why?",
      "response": "I'd reply. The 40% stat is specific enough to be credible, and the ask is low-commitment."
    },
    {
      "persona_name": "Cold Lead — Manager",
      "question": "Would you open, reply, or ignore? Why?",
      "response": "Archive. Nothing here tells me you know anything about my company or my problems."
    }
  ]
}
If cold personas give high NPS scores, your model is too conservative — you’re leaving deals on the table. If hot personas score low, your model over-weights firmographic fit without considering timing or intent.

Salesforce Overview

Back to all 8 Salesforce jobs

Pipeline-Aware Content Generation

Next: Generate stage-specific nurture content