Generate Vobiz call XML
generate_answer_xmlBuild a validated VobizXML call flow from ordered actions like speak, play, gather, record, dial, redirect, or hangup; optionally host it and return a usable answer URL.
Instructions
Build a validated VobizXML document from an ordered list of actions: speak, play, wait, gather (DTMF/speech), record, dial (number or sip_uri), redirect, hangup. Text is XML-escaped; callback/redirect URLs must be on approved hosts; dial numbers must pass the server's destination policy (countries, blocked prefixes, allowlist); actions after redirect/hangup are rejected with invalid_input. Without host it only returns the XML (no API call, works in stdio mode) for you to serve yourself as a make_call answer_url. With host: true (HTTP mode with VOBIZ_PUBLIC_URL) this server also serves it for 24 hours and returns a url usable as make_call answer_url, transfer_call aleg_url or unhold_call resume_url; a hosted gather action posts its digits to this server, readable with get_gather_result and the returned flow_id. For a simple keypad menu prefer gather_dtmf, which builds the step for you; this is the general builder.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | true: also serve the XML from this server for 24 hours and return its url and flow_id (HTTP mode only). Default false: return the XML only. | |
| actions | Yes | 1-20 actions run top to bottom, each an object with `type` plus that element's attributes in snake_case, e.g. [{type:'speak',text:'Hello'},{type:'hangup'}]. A gather's `prompt` holds nested speak/play actions. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | True on success. On a failure the result is isError with ok: false plus `error` (kind), `message`, `retryable` and sometimes `http_status`. | |
| url | No | Only when hosted: https URL Vobiz fetches the XML from (valid 24 hours, lost on server restart). | |
| xml | No | The complete VobizXML document (<Response>...</Response>), ready to serve to Vobiz. | |
| hosted | No | True when this server serves the document at `url`. | |
| method | No | Only when hosted: the HTTP method to give Vobiz for `url` (answer_method / aleg_method). | |
| flow_id | No | Only when hosted: 32-hex id of the hosted flow; pass it to get_gather_result if the XML contains a gather. |