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
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
        • addSection
        • addVerb
        • addVerbToSection
        • ai
        • answer
        • build
        • document
        • getDocument
        • getSchemaUtils
        • hangup
        • play
        • render
        • renderDocument
        • reset
        • say
        • setValidation
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Type
  • Example
AgentsSwmlBuilder

document

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

getDocument

Next
Built with

Read-only getter for the underlying SWML document object. Provides direct access to the mutable document (the returned reference is the internal object, not a copy). Equivalent to the Python SDK’s service property on SWMLBuilder.

Prefer getDocument() when you want an explicit method call for symmetry with other accessors. The document getter exists for callers that want property-style access.

Type

{ version: string; sections: Record<string, unknown[]> }

Example

1import { SwmlBuilder } from '@signalwire/sdk';
2
3const builder = new SwmlBuilder();
4builder.answer();
5
6console.log(builder.document.version); // "1.0.0"
7console.log(builder.document.sections.main.length); // 1