Skip to content
EffiZoom

AI in your agency’s hands

From Inbox to AgencyZoom

Resend email delivery, Gemini AI enrichment, and a direct AgencyZoom API push. Five prompts, real CRM integration, no middleware.

Co-Founder, EffiZoom; licensed insurance agent

· 5 min read

EP 02 takes the EP 01 Form Center from local-only to production-ready: every form fill becomes an email in your inbox, an AI-written brief, and a real lead in your AgencyZoom pipeline. It takes five prompts run in order, with Resend for email delivery, Gemini for enrichment, and a direct AgencyZoom API push, with no middleware.

This episode builds on EP 01, so you need the Form Center running first. If you don’t have it yet, start with Build a Lead Intake Form Center with AI.

Free download

EP 02: From Inbox to AgencyZoom Prompt Guide

All 5 prompts, copy-paste ready, with setup walkthroughs and fix-it prompts.

EP 01 made you capable. EP 02 makes you production-ready.

In EP 01 you built a Form Center: three branded intake forms running locally. Forms submitted, but the data went nowhere. EP 02 is where leads start moving: into your inbox, through an AI enrichment layer, and directly into your AgencyZoom pipeline.

Where EP 01 left off:

  • Three forms running locally: general, auto, home
  • Validation, scoring, and conditional fields wired up
  • A submit handler that doesn’t go anywhere yet

Where EP 02 takes you:

  • Notification email in your inbox in under 5 seconds
  • AI-written brief with priority tier and first-touch line
  • Real lead in your AgencyZoom pipeline, fully tagged
  • No middleware. You own the path.

What you’ll build in EP 02

Five components, layered on top of the EP 01 Form Center. Each one is its own prompt. Run them in order.

  1. Resend Email Delivery (/api/submit-lead). A clean lead notification email lands in your agency inbox in seconds. Validated, formatted, agent-facing, every field included.
  2. Gemini AI Enrichment (/lib/enrichment/gemini.ts). A 2-3 sentence agent brief, Hot/Warm/Cool priority tier, and a recommended first-touch talking point, attached to the email and staged for AZ.
  3. AZ Auth + Discovery (scripts/az-discover.ts). A one-time CLI utility that authenticates with AgencyZoom, fetches your pipelines, stages, and lead sources, and saves your picks to a config file.
  4. AZ createLead Integration (/lib/agencyzoom/client.ts), the payoff. The lead is created directly in AgencyZoom using your IDs. Gemini’s brief goes into notes. The priority tier becomes a tag. No middleware.
  5. Aesthetic Pass (on-camera bonus). Filmed live, not in this guide: a single prompt that polishes the Form Center to feel like a real product, not a wireframe. Watch the video for that one.

End state: a prospect fills out your auto form. In 5 seconds you have an email, an AI brief saying “Hot: shopping due to rate increase, two vehicles, clean record,” and the lead is already in your AZ pipeline with the right stage, source, and tag.

Five prompts. In order.

Each prompt builds on the last. By the end, a form fill becomes a real lead in your CRM, with intelligence already attached.

  1. Resend Email

    Make it functional. Wire up the real submission flow. Form posts to your API, server validates, Resend delivers a clean notification to your inbox in under 3 seconds.

  2. Gemini Enrichment

    Add intelligence. Each submission goes to Gemini 2.5 Flash for a structured brief. Priority tier, summary, first-touch line. Attached to the email.

  3. AZ Auth + Discovery

    Map the CRM. Build a CLI that logs into AgencyZoom, fetches your pipelines and stages, and saves your picks to a config the next prompt will read.

  4. createLead Integration

    Push the lead. On submit, after the email and Gemini, the lead is created directly in AZ via /v1/api/leads. AI brief lands in notes. Priority becomes a tag.

  5. Aesthetic Pass

    On-camera bonus. A single polish prompt that turns the Form Center from working software into something you would actually put in front of a prospect.

The EP 02 Prompt Guide

Five prompts, copy-paste ready, with pre-written answers to every question Claude Code will ask. Plus full Resend, Gemini, and AgencyZoom setup walkthroughs and a fix-it section for the failure modes you’ll likely hit.

The guide is the complete 5-prompt sequence to take your EP 01 Form Center from local-only to production-ready. Every prompt is copy-paste ready. Every likely question from Claude Code has a pre-written answer. Each step has a “how you know it worked” check.

What’s included:

  • All 5 prompts
  • Resend, Gemini, and AgencyZoom setup walkthroughs
  • The .env.example to .env.local pattern (key hygiene)
  • Auth pathways for SSO vs non-SSO agencies
  • An SSO Addendum with a modified Prompt 3
  • An “If Something Goes Wrong” section with paste-back fix-it prompts for the most common Resend, Gemini, and AZ failures

The production habits inside this build

EP 02 isn’t just adding services. It’s teaching the patterns that separate weekend projects from production-ready code. These habits stay with you for every build after this one.

The .env.example to .env.local pattern

Claude Code never sees your real keys. It writes .env.example with placeholders, safe to commit. You copy it to .env.local and paste real keys there. Real keys never leave your machine. This is the single most important habit in the guide.

Ask the system, don’t assume

Every agency configures AgencyZoom differently. Pipeline IDs, stage IDs, lead source IDs: unique to your account. Hardcoding them would break the build for everyone else. The discovery script asks AZ what’s actually there. Production code asks. It does not assume.

Enrichment is enhancement, not blocker

If Gemini fails, the email still sends, with a safe default brief. If AZ push fails, the email still arrives so the lead is captured. Each layer is independent. A failure at one layer never costs you a lead. That is what production resilience looks like.

SSO vs non-SSO auth awareness

If your agency logs into AZ with email + password, the username/password API path works. If you use Google Workspace, Okta, or Microsoft SSO, you need a long-lived API token from AZ support. The guide includes an SSO Addendum with the modified Prompt 3: same flow, different auth header.

The full series

Episode Title What it covers Status
EP 01 Foundation: The Form Center Build the multi-form lead intake system. Three forms, scoring engine, Resend email delivery. No database yet, pure intake. Available
EP 02 From Inbox to AgencyZoom Resend email delivery, Gemini AI enrichment with priority tiers, and a direct AgencyZoom API integration. You are here
EP 03 Public Website Wrapper Wrap the system in a public-facing agency website. Real domain, real DNS, real Resend domain verification. Live on the internet, ready to take a lead from a stranger who found you on Google. Coming soon

Download the EP 02 Prompt Guide and run the five prompts in order. By end of session, a prospect can fill out a form and walk into a real lead in your AgencyZoom pipeline, with an AI brief already attached.

FAQ

Questions about this topic

Do I need to finish EP 01 first?

Yes. EP 02 builds on top of the EP 01 Form Center: three forms, validation, scoring engine. If you don't have that running locally yet, run through EP 01 first. It's a single sitting.

What accounts do I need?

A free Resend account (resend.com), a free Google AI Studio account for the Gemini API (aistudio.google.com), and your AgencyZoom credentials. Resend's free tier is 100 emails/day, plenty for lead intake. Gemini 2.5 Flash on free tier is 15 requests/minute, also plenty.

My agency uses SSO for AgencyZoom. Does this still work?

Yes, with one modification. If you sign in with Google, Microsoft, or Okta, the username/password API path won't work. You'll need to contact AgencyZoom support and request a long-lived API token. The guide includes a full SSO Addendum with a modified Prompt 3: same flow, different auth header.

Will this expose my API keys?

No, if you follow the .env.example pattern. Claude Code only ever writes placeholder files (.env.example) that are safe to commit to Git. Your real keys live in .env.local on your machine and on your production host, nowhere else. The guide walks through this once. Internalize it and you'll never expose a key.

What if Gemini fails or AgencyZoom is down?

Each layer is independent. If Gemini fails, the email still sends with a safe default brief. If AZ push fails, the email still arrives so the lead is captured in your inbox. A failure at one layer never costs you a lead. The guide's fix-it section walks through diagnosing each layer separately.

How long does EP 02 actually take?

If you have all your accounts set up: 1-2 hours. Most of that is reading and verifying, not waiting. The AZ Auth + Discovery prompt is the longest because it's the first time you'll be authenticating against a real third-party API and your config will reflect your specific agency's pipelines and stages.

What does EP 03 add?

EP 03 wraps everything from EP 01 + EP 02 in a real public-facing agency website. Real domain. Real DNS. Real Resend domain verification (so emails don't come from onboarding@resend.dev anymore). Live on the internet, ready to take a lead from a stranger who found you on Google.

Keep reading

AI in your agency’s hands · Guide

Build a Lead Intake Form Center with AI

Domain knowledge is the only prerequisite. AI writes the code, you write the system. Build a real multi-form lead capture system in an afternoon.

· 5 min read

AI in your agency’s hands · Guide

Build Your AI-Optimized Agency Website

A complete guide to building professional, AI-optimized insurance agency websites using Claude Code, even if you have never written a line of code.

· 4 min read

Insurance CRM and agency tech stack · Blog

How to choose a CRM for an insurance agency

A CRM for an insurance agency should fit how work moves through your office. Here are the criteria, the trade-offs and the questions to ask before you buy.

· 5 min read