This recipe creates a support inbox, creates a support call playbook, rents and binds a number, places the call, retrieves the call summary, and sends a follow-up email.
Define the ticket reference, the customer phone number, the customer email, and the area code used for the caller ID search.
export TICKET_ID="4521"
export CUSTOMER_PHONE="+19175550321"
export CUSTOMER_EMAIL="customer@example.com"
export AREA_CODE="415"Create the sender inbox for the follow-up email and the call playbook for the resolution call.
SUPPORT_INBOX=$(spix --json email inbox create \
--username support \
--name "Support Team" \
| jq -r '.data.address')
CALL_PLAYBOOK_ID=$(spix --json playbook create \
--type call \
--name "Support resolution" \
--goal "Resolve the customer billing issue and confirm next steps. Be empathetic and thorough." \
--persona "Patient, knowledgeable support specialist" \
| jq -r '.data.playbook_id')Rent one number in the target area code and bind it to the support call 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" \
--confirmStart the support call and then retrieve the generated summary after the call completes.
CALL_SESSION_ID=$(spix --json call create "$CUSTOMER_PHONE" \
--playbook "$CALL_PLAYBOOK_ID" \
--sender "$SENDER_NUMBER" \
| jq -r '.data.session_id')
spix --json call summary "$CALL_SESSION_ID"Send the follow-up email from the support inbox after the call.
spix --json email send \
--sender "$SUPPORT_INBOX" \
--to "$CUSTOMER_EMAIL" \
--subject "Your support ticket #$TICKET_ID has been resolved" \
--body "Hi, following up on our call. Here is a summary of what we resolved and the next steps."Use the docs to adjust the playbook goal, numbers, inboxes, and follow-up messages for your own customers, leads, patients, or operators.