***

title: setWebHookUrl
slug: /reference/typescript/agents/agent-base/set-web-hook-url
description: Override the default webhook URL used for SWAIG function calls in the SWML document.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ref-agentbase]: /docs/server-sdks/reference/typescript/agents/agent-base

Override the default webhook URL used for SWAIG function calls in the generated SWML
document. By default, the SDK computes this URL from the agent's host, port, and
route. Use this method when your agent is behind a reverse proxy, load balancer, or
tunnel and the auto-detected URL does not match the external address.

<Tip>
  You can also set the `SWML_PROXY_URL_BASE` environment variable to override the base
  URL globally without calling this method.
</Tip>

## **Parameters**

<ParamField path="url" type="string" required={true} toc={true}>
  The full URL that SignalWire should use to reach this agent's SWAIG endpoints.
</ParamField>

## **Returns**

[`AgentBase`][ref-agentbase] -- Returns `this` for method chaining.

## **Example**

```typescript {6}
import { AgentBase } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'support', route: '/support' });
agent.setPromptText('You are a helpful assistant.');
// Agent is behind ngrok
agent.setWebHookUrl('https://abc123.ngrok.io/support');
await agent.serve();
```