For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • BedrockAgent
      • CLI Tools
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions
      • LiveWire
      • MCP Gateway
      • PomBuilder
      • Prefabs
      • Search
      • SkillBase
      • Skills
      • SWAIGFunction
      • SWMLBuilder
      • SWMLService
        • add_section
        • add_verb
        • add_verb_to_section
        • as_router
        • get_basic_auth_credentials
        • get_document
        • manual_set_proxy_url
        • on_request
        • register_routing_callback
        • register_verb_handler
        • render_document
        • reset_document
        • serve
        • stop
      • WebService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • Chat
      • Compat
      • Datasphere
      • Fabric
      • Imported Numbers
      • Logs
      • Lookup
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSub
      • Queues
      • Recordings
      • Registry
      • RestClient
      • Short Codes
      • SignalWireRestError
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Returns
  • Example
AgentsSWMLService

get_document

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

manual_set_proxy_url

Next
Built with

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:

1{
2 "version": "1.0.0",
3 "sections": {
4 "main": [
5 {"answer": {}},
6 {"ai": {...}}
7 ]
8 }
9}

Example

1from signalwire import SWMLService
2
3service = SWMLService(name="my-service")
4service.add_verb("answer", {})
5service.add_verb("play", {"url": "https://example.com/audio.mp3"})
6
7doc = service.get_document()
8print(doc["version"]) # "1.0.0"
9print(len(doc["sections"]["main"])) # 2