This recipe creates one call playbook and one SMS playbook, rents a sender number, binds it to both channels, places the coordination call, and sends the written delivery confirmation.
Define the customer phone number and the area code used for the delivery coordinator number.
export CUSTOMER_PHONE="+19175550222"
export AREA_CODE="415"Create the voice playbook for delivery coordination and the SMS playbook for the written confirmation.
CALL_PLAYBOOK_ID=$(spix --json playbook create \
--type call \
--name "Delivery coordination" \
--goal "Confirm the delivery window, collect access instructions, and note any special handling requirements." \
--persona "Efficient, friendly logistics coordinator" \
| 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 flow, bind it to the call playbook at purchase time, 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 send the written confirmation from the same number.
spix --json call create "$CUSTOMER_PHONE" \
--playbook "$CALL_PLAYBOOK_ID" \
--sender "$SENDER_NUMBER"
spix --json sms send "$CUSTOMER_PHONE" \
--sender "$SENDER_NUMBER" \
--playbook "$SMS_PLAYBOOK_ID" \
--body "Delivery confirmed for tomorrow 2-4pm. Access code: 4521. Driver will call on arrival. Reply to reschedule."Use the docs to adjust the playbook goal, numbers, inboxes, and follow-up messages for your own customers, leads, patients, or operators.