> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # renderSwml > Render the complete SWML document by assembling all 5 phases. Render the complete SWML document by assembling all 5 phases: pre-answer, answer, post-answer, AI, and post-AI verbs. This is called automatically by the Hono route handler on each incoming request, but can also be called manually for testing or debugging. ## **Parameters** **`callId`** `string` Optional call ID to use for session tokens. Auto-generated if omitted. --- **`modifications`** `Record` Optional object (typically returned from [`onSwmlRequest()`](/docs/server-sdks/reference/typescript/agents/agent-base/on-swml-request)) merged into the AI verb config before rendering. `global_data` is deep-merged; all other keys override AI config fields directly. --- ## **Returns** `string` -- The rendered SWML document as a JSON string. ## **Example** ```typescript {7} import { AgentBase } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'support', route: '/support' }); agent.setPromptText('You are a helpful assistant.'); agent.addHints(['SignalWire', 'SWML']); const swml = agent.renderSwml(); console.log(JSON.parse(swml)); ``` > Render the complete SWML document by assembling all 5 phases.