Skip to main content

Endpoints

BRTC introduces the concept of an Endpoint: any device that can make or receive a call. Currently, BRTC only supports WebRTC Endpoints. Visit the Endpoints API reference for more information on how to manage your Endpoints. The Endpoints APIs are available in all of our SDKs.

WebRTC Endpoints are devices that use the WebRTC protocol to make and receive calls — browsers, mobile applications, or any other device that supports WebRTC.

The kind of Endpoint, and its related metadata, tell Bandwidth how to communicate with that Endpoint and let you control its lifecycle. See the BRTC FAQs for guidance on Endpoint eligibility, session lifecycle, and reuse.

During the lifecycle of an Endpoint, you can opt to receive webhooks that inform your platform of Endpoint lifecycle state changes as they happen, including:

  • When a device connects or disconnects using an Endpoint token
  • Each unique connection of an Endpoint is assigned a Device ID for easier tracking
  • When a device has negotiated with Bandwidth and is available to be <Connect>ed with
  • When a device is <Connect>ed
  • When a device has concluded a call and is available again

Examples

Register a WebRTC Endpoint

curl -X POST https://api.bandwidth.com/v2/accounts/{accountId}/endpoints \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"type": "WEBRTC",
"direction": "BIDIRECTIONAL",
"eventCallbackUrl": "https://myEventCallbackUrl.com/callbacks/bandwidth",
"eventFallbackUrl": "https://fallback.myEventCallbackUrl.com/callbacks/bandwidth",
"tag": "{\"myTag\": \"myTagValue\"}"
}'