> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # output > Set the output template for a webhook. [functionresult]: /docs/server-sdks/reference/typescript/agents/function-result [ref-datamap]: /docs/server-sdks/reference/typescript/agents/data-map [fallback-output]: /docs/server-sdks/reference/typescript/agents/data-map/fallback-output Set the output for the most recently added webhook. The [`FunctionResult`][functionresult] template is filled with response data after the API call succeeds. > **Tip** > > Always set a [`fallbackOutput`][fallback-output] so the AI has something meaningful > to say even when external APIs are unavailable. ## **Parameters** **`result`** `FunctionResult` — required A FunctionResult defining the response template. Use `${response.field}` to reference API response fields. --- ## **Returns** [`DataMap`][ref-datamap] -- Self for method chaining. Throws an `Error` if no webhook has been added yet. ## **Example** ```typescript {5} import { DataMap, FunctionResult } from '@signalwire/sdk'; const dm = new DataMap('get_weather'); dm.webhook('GET', 'https://api.weather.com/v1/current'); dm.output(new FunctionResult('The weather is ${response.current.condition.text}.')); ``` > Set the output template for a webhook.