> This page is for Server SDKs.

> 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.

# get_document

> Get the current SWML document as a Python dictionary.

Get the current SWML document as a Python dictionary. The returned structure follows
the standard SWML format with `version` and `sections` keys.

## **Returns**

`dict[str, Any]` — The current SWML document. Structure:

```json
{
    "version": "1.0.0",
    "sections": {
        "main": [
            {"answer": {}},
            {"ai": {...}}
        ]
    }
}
```

## **Example**

```python {7}
from signalwire import SWMLService

service = SWMLService(name="my-service")
service.add_verb("answer", {})
service.add_verb("play", {"url": "https://example.com/audio.mp3"})

doc = service.get_document()
print(doc["version"])       # "1.0.0"
print(len(doc["sections"]["main"]))  # 2
```