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 best reps already know the winning language — it’s buried in their deal notes. This job queries Notes attached to Closed Won opportunities, aggregates the value-prop phrasing that closes deals, and feeds it into Mavera’s Brand Voice engine. The output is a “Sales Winning Language” voice profile that marketing can use to mirror phrases that actually convert.

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}"}

opps = requests.get(
    f"https://{SF}/services/data/v66.0/query", headers=SF_H,
    params={"q": "SELECT Id FROM Opportunity WHERE StageName = 'Closed Won' ORDER BY CloseDate DESC LIMIT 50"},
).json()["records"]

opp_ids = "','".join(o["Id"] for o in opps)
notes = requests.get(
    f"https://{SF}/services/data/v66.0/query", headers=SF_H,
    params={"q": f"SELECT Title, Body FROM Note WHERE ParentId IN ('{opp_ids}') ORDER BY CreatedDate DESC LIMIT 200"},
).json()["records"]

combined = "\n\n---\n\n".join(
    f"[{n.get('Title', 'Untitled')}]\n{n.get('Body', '')}" for n in notes
)[:50_000]

bv = requests.post(
    "https://app.mavera.io/api/v1/brand-voices",
    headers={"Authorization": f"Bearer {MV_K}", "Content-Type": "application/json"},
    json={"name": "Sales Winning Language", "extracted_content": combined},
).json()

print(f"Brand Voice ID: {bv['id']} — extracted from {len(notes)} notes across {len(opps)} won deals")

Example Output

{
  "id": "bv_7mP3q",
  "name": "Sales Winning Language",
  "traits": {
    "tone": "Confident, consultative, outcome-focused",
    "vocabulary": ["speed-to-value", "de-risk", "proof-of-concept", "time-to-revenue", "operationalize"],
    "patterns": [
      "Leads with customer pain before product features",
      "Uses specific ROI numbers from similar customers",
      "Frames pricing as investment with payback period"
    ],
    "avoid": ["Generic 'best-in-class' claims", "Feature lists without business context"]
  }
}
Re-run quarterly as your sales team evolves. Compare voice profiles over time to track how winning language shifts with market conditions.

Salesforce Overview

Back to all 8 Salesforce jobs

Lead Scoring Validation

Next: Validate lead scoring with synthetic focus groups