***

title: render_document
slug: /reference/python/agents/swml-service/render-document
description: Render the current SWML document as a JSON string.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Render the current SWML document as a JSON string. This is the serialized form
that gets returned to SignalWire when a call requests SWML.

## **Returns**

`str` — The SWML document serialized as a JSON string.

## **Example**

```python {7}
from signalwire import SWMLService

service = SWMLService(name="my-service")
service.add_verb("answer", {})
service.add_verb("hangup", {})

json_str = service.render_document()
print(json_str)
# '{"version": "1.0.0", "sections": {"main": [{"answer": {}}, {"hangup": {}}]}}'
```