Recipe
Lead Qualification
This recipe creates one qualification playbook with an extract schema, rents and binds a sender number, places the qualification call, and retrieves the summary with structured output.
Voice
Set lead variables
Define the lead phone number and the area code for the rented caller ID.
Set lead variables
export LEAD_PHONE="+19175550987"
export AREA_CODE="415"Create the qualification playbook
Add an extract schema so the summary command can return structured qualification data after the call.
Create the qualification playbook
CALL_PLAYBOOK_ID=$(spix --json playbook create \
--type call \
--name "Lead qualification" \
--goal "Determine budget range, implementation timeline, and whether the contact is the decision-maker. Classify as hot, warm, or cold." \
--persona "Curious, professional business development rep" \
--extract '{"qualification":"string","budget":"string","timeline":"string","decision_maker":"boolean"}' \
| jq -r '.data.playbook_id')Rent and bind the sender number
Rent one number and bind it to the lead-qualification playbook.
Rent and bind the sender number
SENDER_NUMBER=$(spix --json phone rent --area-code "$AREA_CODE" --limit 1 | jq -r '.data[0].number')
spix --json phone rent \
--number "$SENDER_NUMBER" \
--bind-channel call \
--bind-playbook "$CALL_PLAYBOOK_ID" \
--confirmCall the lead and inspect the summary
Create the call, then retrieve the summary and extracted fields with the session ID.
Call the lead and inspect the summary
CALL_SESSION_ID=$(spix --json call create "$LEAD_PHONE" \
--playbook "$CALL_PLAYBOOK_ID" \
--sender "$SENDER_NUMBER" \
| jq -r '.data.session_id')
spix --json call summary "$CALL_SESSION_ID"Build your own recipe
Install Spix, then adapt this recipe to your own flow.
Use the docs to adjust the playbook goal, numbers, inboxes, and follow-up messages for your own contacts and channels.