This recipe creates one call playbook and one SMS playbook, rents a sender number, binds it to both channels, places the delivery coordination call, and sends the written update by text.
Define the courier phone number, the text recipient, and the area code for the outgoing number.
export COURIER_PHONE="+19175550222"
export MY_PHONE="+19175550124"
export AREA_CODE="415"Create the voice playbook for the coordination call and the SMS playbook for the follow-up text.
CALL_PLAYBOOK_ID=$(spix --json playbook create \
--type call \
--name "Delivery coordination" \
--goal "Call the courier, confirm the delivery window, collect access instructions, and note any special handling requirements." \
--persona "Efficient, friendly personal assistant" \
| jq -r '.data.playbook_id')
SMS_PLAYBOOK_ID=$(spix --json playbook create \
--type sms \
--name "Delivery coordination texts" \
--use-case delivery_notifications \
| jq -r '.data.playbook_id')Rent one number for the workflow, bind it to the call playbook, then add the SMS binding.
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" \
--confirm
spix --json phone bind "$SENDER_NUMBER" \
--channel sms \
--playbook "$SMS_PLAYBOOK_ID"Create the coordination call, then text the confirmed window and instructions back.
spix --json call create "$COURIER_PHONE" \
--playbook "$CALL_PLAYBOOK_ID" \
--sender "$SENDER_NUMBER"
spix --json sms send "$MY_PHONE" \
--sender "$SENDER_NUMBER" \
--playbook "$SMS_PLAYBOOK_ID" \
--body "Delivery is confirmed for tomorrow from 2-4pm. The driver will call on arrival and needs the gate code."Use the docs to adjust the playbook goal, numbers, inboxes, and follow-up messages for your own customers, leads, patients, or operators.