> 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. # renderDocument > Render the current SWML document as a JSON string. [ref-getdocument]: /docs/server-sdks/reference/typescript/agents/swml-service/get-document [ref-renderswml]: /docs/server-sdks/reference/typescript/agents/swml-service/render-swml Render the current SWML document as a JSON string. This is the serialized form returned to SignalWire when a call requests SWML. Delegates to `SwmlBuilder.render()` under the hood. > **Note** > > For the document as a plain object, use [`getDocument()`][ref-getdocument] or > [`renderSwml()`][ref-renderswml] instead. ## **Returns** `string` — The SWML document serialized as a JSON string. ## **Example** ```typescript {7} import { SWMLService } from '@signalwire/sdk'; const service = new SWMLService({ name: 'my-service' }); service.addVerb('answer', {}); service.addVerb('hangup', {}); const jsonStr = service.renderDocument(); console.log(jsonStr); // '{"version":"1.0.0","sections":{"main":[{"answer":{}},{"hangup":{}}]}}' ``` > Render the current SWML document as a JSON string.