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

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": {}}]}}