Skip to main content

Endpoints

BRTC introduces the concept of an Endpoint, which is any device that can make or receive a call. Currently, BRTC supports 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. These devices can be browsers, mobile applications, or any other device that supports WebRTC.

The kind of Endpoint, and related metadata, are meant to instruct Bandwidth on how to communicate with that Endpoint, and allows control of the Endpoint's lifecycle.

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

  • 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\"}"
}'