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
        • body
        • description
        • enableEnvExpansion
        • errorKeys
        • expression
        • fallbackOutput
        • foreach
        • globalErrorKeys
        • helpers
        • output
        • parameter
        • params
        • purpose
        • registerWithAgent
        • setAllowedEnvPrefixes
        • toSwaigFunction
        • webhook
        • webhookExpressions
      • 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
AgentsDataMap

body

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

description

Next
Built with

Set the request body for the most recently added webhook. Used for POST/PUT requests. Writes to the body key of the webhook definition.

body() and params() write to different keys in the webhook specification: body sets the request body, while params sets query/form parameters.

Parameters

data
Record<string, unknown>Required

Request body data. Supports ${variable} substitutions.

Returns

DataMap — Self for method chaining. Throws an Error if no webhook has been added yet.

Example

1import { DataMap, FunctionResult } from '@signalwire/sdk';
2
3const search = new DataMap('search_docs');
4search
5 .purpose('Search documentation')
6 .parameter('query', 'string', 'Search query', { required: true })
7 .webhook('POST', 'https://api.docs.example.com/search', {
8 headers: { Authorization: 'Bearer TOKEN' },
9 })
10 .body({ query: '${args.query}', limit: 3 })
11 .output(new FunctionResult('Found: ${response.results[0].title}'));