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
        • AuthHandler
        • ConfigLoader
        • Environment Variables
        • Logging
        • PromptManager
        • SchemaUtils
          • clearCache
          • getCacheSize
          • getVerbDescription
          • getVerbNames
          • getVerbProperties
          • getVerbRequiredProperties
          • hasVerb
          • validate
          • validateVerb
        • ServerlessAdapter
        • SessionManager
        • SslConfig
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • 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
AgentsConfigurationSchemaUtils

validate

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

validateVerb

Next
Built with

Validate a SWML document against structural rules. Checks for required top-level keys (version, sections), valid version strings, a main section, and correct AI verb structure. Results are cached.

Parameters

swml
string | Record<string, unknown>Required

The SWML document as a JSON string or parsed object.

Returns

ValidationResult — An object with valid: boolean and errors: string[].

Example

1import { SchemaUtils } from '@signalwire/sdk';
2
3const schema = new SchemaUtils();
4const result = schema.validate({
5 version: '1.0.0',
6 sections: { main: [{ answer: {} }, { hangup: {} }] },
7});
8
9if (!result.valid) {
10 console.error('Validation errors:', result.errors);
11}