Skip to main content

Joining & Creating Calls

Creating a call

You create a call by specifying a "call type" and a call id.

val call = client.call("default", "123")
val result = call.create()

The call type controls which features are enabled, and sets up permissions.

For the call id there are a few things to note:

  • You can reuse the same call multiple times.
  • If you have a unique id for the call we recommend passing that as the id.
  • If you don't have a unique id you can leave it empty and we'll generate one for you.

As an example, if you're building a telemedicine app, calls will be connected to an appointment. Using your own appointment id as the call id makes it easy to find the call later.

Joining a call

Joining a call sets up the realtime communication for audio and video.

val call = client.call("default", "123")
val result = call.join()

Call CRUD

Basic CRUD operations are available on the call object

// create
val call = client.call("default", "123")
val result = call.create()

// update
val custom = mutableMapOf("secret" to secret)
val updateResult = call.update(custom = custom)

// get
val getResult = call.get()

Call Create Options

This example shows how to create a call with members and custom data:

val members = listOf("thierry", "tommaso")
val call = client.call("default", randomUUID())

val result = call.create(memberIds = members, custom = mapOf("color" to "red"), ring = true)

Members are permanently associated with a call. It allows you to:

  • Restrict the ability to join a call only to members
  • Send a push notification to members when the call starts

The following options are supported when creating a call:

OptionDescriptionDefault
memberIdsA list of users ids to add as members to this call-
membersA list of members to add to this call. You can specify the role and custom data on these members-
customAny custom data you want to store-
settingsYou can overwrite certain call settings for this specific call. This overwrites the call type standard settings-
startsAtWhen the call will start. Used for calls scheduled in the future, livestreams, audio rooms etc-
teamRestrict the access to this call to a specific team-
ringIf you want the call to ring for each memberfalse

Querying Members

You can query the members of the call. This is helpful if you have thousands of members in a call and want to paginate.

val filters = mapOf("user_id" to "jaewoong")
val response = call.queryMembers(filters, listOf(SortField.Desc("created_at")), 5)

You can filter the member list on these fields, and sort on the selected fields. Note that you can also query on custom data for the member or the user.

OptionDescriptionSorting Supported
user_idThe user's idYes
roleThe member's roleNo
customThe custom data on the memberNo
created_atWhen the member was createdYes
updated_atWhen the member was last updatedNo

Did you find this page helpful?