params

View as MarkdownOpen in Claude

Set request query/form parameters for the most recently added webhook. Writes to the params key of the webhook definition.

params() is not an alias for body(). They 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 parameters. 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 dm = new DataMap('search_docs');
4dm.purpose('Search documentation');
5dm.parameter('query', 'string', 'Search query', { required: true });
6dm.webhook('GET', 'https://api.docs.example.com/search');
7dm.params({ q: '${args.query}', limit: 10 });
8dm.output(new FunctionResult('Found: ${response.results[0].title}'));