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
  • Parameters
  • Returns
  • Example
AgentsSWMLService

add_section

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

add_verb

Next
Built with

Add a new empty section to the SWML document. Sections are named containers for ordered lists of verbs. Every document starts with a main section.

Parameters

section_name
strRequired

Name of the section to create. Must be unique within the document.

Returns

bool — True if the section was created, False if a section with that name already exists.

Example

1from signalwire import SWMLService
2
3service = SWMLService(name="multi-section")
4service.add_section("fallback")
5service.add_verb_to_section("fallback", "play", {
6 "url": "https://example.com/sorry.mp3"
7})
8service.add_verb_to_section("fallback", "hangup", {})
9
10print(service.render_document())