***

title: build
slug: /reference/python/agents/swml-builder/build
description: Build and return the complete SWML document as a dictionary.
max-toc-depth: 3
---------------------

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

[swmlservice-get-document]: /docs/server-sdks/reference/python/agents/swml-service/get-document

Build and return the complete SWML document as a Python dictionary. Delegates to
[`SWMLService.get_document()`][swmlservice-get-document].

## **Returns**

`dict[str, Any]` -- The complete SWML document.

## **Example**

```python {6}
from signalwire import SWMLService, SWMLBuilder

service = SWMLService(name="demo")
builder = SWMLBuilder(service)

doc = builder.answer().hangup().build()
print(doc)
# {"version": "1.0.0", "sections": {"main": [{"answer": {}}, {"hangup": {}}]}}
```