DataMap
DataMap builds SWAIG function definitions that execute REST API calls directly on SignalWire’s infrastructure — no webhook endpoint required on your server. This reduces latency, simplifies deployment, and is ideal for straightforward API-to-response integrations.
Use DataMap when you need to call an external REST API and format the response with simple variable substitution. For complex business logic, database access, or multi-step processing, use a standard SWAIG function with a handler instead.
See SwaigFunction for
handler-based tool definitions, and
FunctionResult for the
response builder used in DataMap outputs.
DataMap generates a SWML data_map object
within a SWAIG function definition. See the
SWML data_map reference for the
full specification.
Properties
functionName
Name of the SWAIG function this DataMap will create.
Variable Substitution Patterns
Modifiers are applied right-to-left: ${enc:lc:args.param} lowercases first,
then URL-encodes.
Methods
Set the request body for a webhook.
Set error detection keys for webhook responses.
Add a pattern-based response without an API call.
Process an array from the webhook response.
Convenience functions for creating common DataMap patterns.
Set the output template for a webhook.
Add a function parameter to the tool definition.
Set the function description shown to the AI.
Convert the DataMap to a SWAIG function definition object.
Add an API call to the DataMap.
Add post-processing expressions for a webhook response.
Alias for purpose — set the function description.
Set query or form parameters for a webhook.
Set the fallback output when no webhook or expression matches.
Set top-level error detection keys.
Enable environment variable expansion.
Override allowed env var prefixes for this DataMap.
Register this DataMap tool with an AgentBase instance.