returns object that describes the data you want out of the conversation. Every call that agent handles (inbound or outbound) runs against that schema. After the call ends, CallingBox reads the transcript and extracts those fields into structured JSON.
Defining a schema
Each key inreturns is a field name. Each value is a type hint: "boolean", "string", or "number".
Reading the result
Once the call finishes and extraction completes, theresult field on the call object has the extracted data:
null.
Result statuses
Extraction is a separate step that runs after the call ends. Track it withresult_status:
| Status | What it means |
|---|---|
pending | Still extracting |
completed | Done; data is in result |
failed | Extraction broke; reason is in result_error |
When extraction doesn’t run
If the call ends without a real conversation (no answer, voicemail, busy), no extraction runs. All return fields come back asnull and result_status stays pending.
If the agent has no returns schema, the result field on every call from that agent is null.
Tips
- Keep schemas flat. One level of keys with simple types works best.
- Use descriptive field names.
reschedule_toextracts better thanfield_2. - One goal per call. The more focused the instructions, the more accurate the extraction. If an agent has very different jobs, split it into multiple agents.
Agents
Where
returns lives.Outbound calls
Dispatch a call from an outbound agent.
Webhooks
Polling vs webhooks for getting results.
Call object
Every field on the call response.