For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
        • create
        • delete
        • get
        • list
        • search
        • setAiAgent
        • setCallFlow
        • setCxmlApplication
        • setCxmlWebhook
        • setRelayApplication
        • setRelayTopic
        • setSwmlWebhook
        • update
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Parameters
  • Returns
  • Example
REST ClientPhone Numbers

setRelayTopic

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

setSwmlWebhook

Next
Built with

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 that sets call_handler to relay_topic and populates call_relay_topic for you.

Parameters

resourceId
stringRequired

ID of the phone number to bind.

params
SetRelayTopicParamsRequired

Topic name and options.

params.topic
stringRequired

RELAY topic name. Serialized as call_relay_topic.

params.statusCallbackUrl
string

URL that receives status updates for calls routed via this topic. Serialized as call_relay_topic_status_callback_url.

Returns

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

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient({
4 project: "your-project-id",
5 token: "your-api-token",
6 host: "your-space.signalwire.com"
7});
8
9await client.phoneNumbers.setRelayTopic("phone-number-id", {
10 topic: "office",
11 statusCallbackUrl: "https://example.com/status",
12});