> 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 current SWML document as a JSON object. Render the current SWML document. For a plain `SWMLService`, this delegates to the underlying `SwmlBuilder`'s `build()` method and returns the in-memory document object. The signature accepts optional `callId` and `modifications` arguments. These are unused by the base `SWMLService` implementation but are part of the override-friendly signature: `AgentBase` overrides `renderSwml()` to consume them and returns a serialized JSON string instead. ## **Parameters** **`callId`** `string` Optional call id. Used by the `AgentBase` override; ignored by a plain `SWMLService`. --- **`modifications`** `Record` Optional SWML modifications. Used by the `AgentBase` override; ignored by a plain `SWMLService`. --- ## **Returns** `Record | string` -- A plain `SWMLService` returns the in-memory document object (with `version` and `sections`); the `AgentBase` override returns a serialized JSON string. ## **Example** ```typescript {8} import { SWMLService } from '@signalwire/sdk'; const service = new SWMLService({ name: 'my-ivr' }); service.addVerb('answer', {}); service.addVerb('play', { url: 'https://example.com/greeting.mp3' }); service.addVerb('hangup', {}); const doc = service.renderSwml(); console.log(JSON.stringify(doc, null, 2)); // { // "version": "1.0.0", // "sections": { // "main": [ // { "answer": {} }, // { "play": { "url": "https://example.com/greeting.mp3" } }, // { "hangup": {} } // ] // } // } ``` > Render the current SWML document as a JSON object.