Server SDKs
Build AI agents, control calls, send messages, and more
render_document
Render the current SWML document as a JSON string. This is the serialized form that gets returned to SignalWire when a call requests SWML.
str — The SWML document serialized as a JSON string.
str
1from signalwire import SWMLService23service = SWMLService(name="my-service")4service.add_verb("answer", {})5service.add_verb("hangup", {})67json_str = service.render_document()8print(json_str)9# '{"version": "1.0.0", "sections": {"main": [{"answer": {}}, {"hangup": {}}]}}'