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

addVerb

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

addVerbToSection

Next
Built with

Append a verb to the main section of the SWML document. Validates the verb config against the bundled schema when validation is enabled.

Parameters

verbName
stringRequired

The SWML verb name (e.g., "answer", "ai", "play", "hangup").

config
unknownRequired

The verb’s configuration payload. Most verbs accept an object of parameters. The sleep verb accepts a number (duration in milliseconds).

Returns

void — Throws an Error if the verb fails schema validation (when validation is enabled and the verb is defined in the schema).

Example

1import { SwmlBuilder } from '@signalwire/sdk';
2
3const builder = new SwmlBuilder();
4builder.addVerb('answer', {});
5builder.addVerb('play', { url: 'https://example.com/greeting.mp3' });
6builder.addVerb('hangup', {});
7
8console.log(builder.renderDocument());