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

# setRelayTopic

> Route inbound calls to a RELAY topic.

[update]: /docs/server-sdks/reference/typescript/rest/phone-numbers/update

Route inbound calls on this phone number to a RELAY topic. RELAY clients
subscribed to the topic will receive the inbound call event.

This is a typed wrapper over [`update`][update] that sets `call_handler` to
`relay_topic` and populates `call_relay_topic` for you.

## **Parameters**

<ParamField path="resourceId" type="string" required={true} toc={true}>
  ID of the phone number to bind.
</ParamField>

<ParamField path="params" type="SetRelayTopicParams" required={true} toc={true}>
  Topic name and options.
</ParamField>

<ParamField path="params.topic" type="string" required={true} toc={true}>
  RELAY topic name. Serialized as `call_relay_topic`.
</ParamField>

<ParamField path="params.statusCallbackUrl" type="string" toc={true}>
  URL that receives status updates for calls routed via this topic. Serialized
  as `call_relay_topic_status_callback_url`.
</ParamField>

## **Returns**

`Promise<any>` — The updated phone-number resource.

## **Example**

```typescript {9-12}
import { RestClient } from "@signalwire/sdk";

const client = new RestClient({
  project: "your-project-id",
  token: "your-api-token",
  host: "your-space.signalwire.com"
});

await client.phoneNumbers.setRelayTopic("phone-number-id", {
  topic: "office",
  statusCallbackUrl: "https://example.com/status",
});
```