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
        • connect
        • dial
        • disconnect
        • execute
        • onCall
        • onMessage
        • receive
        • run
        • sendMessage
        • unreceive
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • 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
RELAYRelayClient

unreceive

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

RelayError

Next
Built with

Unsubscribe from contexts for inbound call and message events. Sends a signalwire.unreceive request to stop receiving events on the specified contexts. This is the inverse of receive().

After unsubscribing, inbound calls routed to those contexts will no longer trigger the onCall() handler on this client.

Parameters

contexts
string[]Required

List of context names to unsubscribe from. If the list is empty, the method returns immediately without sending a request.

Returns

Promise<void>

Example

1import { RelayClient } from '@signalwire/sdk';
2
3const client = new RelayClient({
4 project: process.env.SIGNALWIRE_PROJECT_ID!,
5 token: process.env.SIGNALWIRE_API_TOKEN!,
6 contexts: ['sales', 'support', 'billing']
7});
8
9client.onCall(async (call) => {
10 await call.answer();
11
12 // Dynamically unsubscribe from "billing" after the first call
13 await client.unreceive(['billing']);
14 console.log('Unsubscribed from billing context');
15
16 await call.hangup();
17});
18
19await client.run();