Skip to content

Handoff

Handoff is how the assistant gets a person involved. Use the API to see what is waiting, step in, and change when the assistant puts calls through. Keys need the handoff:* scope.

Calls in progress that need a person, or that someone has already taken over:

Terminal window
curl https://app.airfone.app/v1/handoff/calls \
-H "Authorization: Bearer $AIRFONE_KEY"

Each call has an attention line saying why (“asked for a person”). Add ?all=true to see every call in progress.

Messages left for a person, such as voicemail, come from GET /v1/handoff/messages. Claim one with POST /v1/handoff/messages/{id}/claim and close it with .../done. If someone else already claimed it you get a 409.

Terminal window
curl -X POST https://app.airfone.app/v1/handoff/calls/$CALL_ID/takeover \
-H "Authorization: Bearer $AIRFONE_KEY"

The assistant pauses and you get a room url and a short-lived token to join and speak. When you are done:

Terminal window
curl -X POST https://app.airfone.app/v1/handoff/calls/$CALL_ID/release \
-H "Authorization: Bearer $AIRFONE_KEY"

The assistant carries on and is told a person spoke with the caller. Only one person can have a call at a time.

A rule says when to put a call through and to whom.

Terminal window
curl -X POST https://app.airfone.app/v1/handoff/rules \
-H "Authorization: Bearer $AIRFONE_KEY" \
-H "Content-Type: application/json" \
-d '{"trigger":{"kind":"topic","text":"refund"},"hours":"business","target":"team:TEAM_ID"}'

trigger.kind is wants_human, asks_for_target, upset, topic or words. The last two need text. hours is any, business or after. target is team:<id>, user:<id>, several joined by commas, or named for whoever the caller asked for.

List with GET /v1/handoff/rules. Replace with PUT /v1/handoff/rules/{id}, remove with DELETE, and set the order by sending {"ids": [...]} to PUT /v1/handoff/rules/order.

Terminal window
curl -X PUT https://app.airfone.app/v1/handoff/hours \
-H "Authorization: Bearer $AIRFONE_KEY" \
-H "Content-Type: application/json" \
-d '{"hours":{"mon":[["09:00","18:00"]]},"timezone":"Asia/Kathmandu","holidays":["2026-10-20"]}'

An empty hours object means always open. Leave out timezone or holidays to keep them as they are; send [] to clear holidays.

Changing rules and hours needs an organisation admin. Taking over a call needs permission to step into calls.