A personalized video message makes someone’s day. But recording individual videos for every employee birthday, customer milestone, or team celebration doesn’t scale past a handful of people.
TEMPLATES = { "birthday": { "prompt": """Create a 20-second birthday video for {name}.The presenter should be warm and genuine: "Happy birthday, {name}!From everyone at {company}, we hope your day is amazing.{personal_note}Here's to a great year ahead!"Tone: Celebratory, warm, genuine — like a friend, not a corporate card.Background: Festive but tasteful. Include subtle confetti or balloons.""", }, "work_anniversary": { "prompt": """Create a 25-second work anniversary video for {name}."Congratulations {name} on {years} years at {company}!{achievement_note}Thank you for everything you bring to the team. Here's to many more!"Tone: Appreciative and sincere. Professional but warm.""", }, "welcome": { "prompt": """Create a 20-second welcome video for {name} joining {team}."Welcome to {company}, {name}! We're so excited to have you on the{team} team. {welcome_note}Can't wait to work with you!"Tone: Enthusiastic, welcoming, energetic.""", }, "customer_milestone": { "prompt": """Create a 20-second milestone video for {name} at {company}."Hey {name}, we just wanted to say thank you. {milestone_detail}We really appreciate your trust in us. Here's to what's next!"Tone: Grateful, personal, not salesy.""", },}
2
Generate for a batch of recipients
import requestsimport timerecipients = [ { "name": "Sarah Chen", "occasion": "birthday", "company": "Acme Corp", "personal_note": "We heard you're celebrating with a trip to Japan — enjoy every moment!", }, { "name": "Marcus Johnson", "occasion": "work_anniversary", "company": "Acme Corp", "years": "5", "achievement_note": "From leading the product launch to mentoring three new engineers — your impact has been incredible.", }, { "name": "Priya Patel", "occasion": "welcome", "company": "Acme Corp", "team": "Engineering", "welcome_note": "The team has been looking forward to having a Kubernetes expert on board.", },]jobs = []for r in recipients: template = TEMPLATES[r["occasion"]] prompt = template["prompt"].format(**r) resp = requests.post( "https://api.heygen.com/v3/video-agents", headers={ "X-Api-Key": HEYGEN_API_KEY, "Content-Type": "application/json", }, json={"prompt": prompt}, ) jobs.append({ "recipient": r, "video_id": resp.json()["data"]["video_id"], }) time.sleep(5)
Then poll for completion and deliver via email, Slack, or your HR platform.