build

View as MarkdownOpen in Claude

Build and return the complete SWML document as a Python dictionary. Delegates to SWMLService.get_document().

Returns

dict[str, Any] — The complete SWML document.

Example

1from signalwire import SWMLService, SWMLBuilder
2
3service = SWMLService(name="demo")
4builder = SWMLBuilder(service)
5
6doc = builder.answer().hangup().build()
7print(doc)
8# {"version": "1.0.0", "sections": {"main": [{"answer": {}}, {"hangup": {}}]}}