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.
Define the lead phone number and the area code for the rented caller ID.
export LEAD_PHONE="+19175550987"
export AREA_CODE="415"Add an extract schema so the summary command can return structured qualification data after the call.
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 one number and bind it to the lead-qualification playbook.
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" \
--confirmCreate the call, then retrieve the summary and extracted fields with the session ID.
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"Use the docs to adjust the playbook goal, numbers, inboxes, and follow-up messages for your own customers, leads, patients, or operators.