Skip to navigation

params

View as MarkdownOpen in Claude

Set the JSON request body for the most recently added webhook, written as its params. body() does the same.

The platform sends params as the request’s JSON body, not as URL query parameters, expanding templates in its values first, and a webhook with params is always a POST, whatever its method. Put query-string values for a GET request in the URL instead.

Parameters

data
Record<string, unknown>Required

Request body object. Values can contain templates, which read the call data, so arguments are ${args.name}.

Returns

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

Example

import { DataMap, FunctionResult } from '@signalwire/sdk';
const dm = new DataMap('search_docs');
dm.purpose('Search documentation');
dm.parameter('query', 'string', 'Search query', { required: true });
dm.webhook('POST', 'https://api.docs.example.com/search');
dm.params({ q: '${args.query}', limit: 10 });
dm.output(new FunctionResult('Found: ${results[0].title}'));