LiveKit RoomService API — create and administer rooms and participants.
Every function is a thin wrapper around LiveKit.Twirp.call/6. It builds the
protobuf request from keyword options, signs a short-lived service token that
carries only the grants that method needs, and returns
{:ok, response} | {:error, %LiveKit.Error{}}.
iex> client = LiveKit.Client.new!(url: "http://localhost:7880", api_key: "k", api_secret: "s")
iex> {:error, error} = LiveKit.RoomService.delete_room(client, [])
iex> error.type
:validationRequired options are validated before any HTTP request is made. Nested
protobuf fields such as :egress, :agents, :permission and :attributes
accept the corresponding LiveKit.Proto.* values directly.
Summary
Functions
Creates a room with the given settings.
Deletes a room by name. Requires :room.
Forwards a participant's tracks to another room (cloud-only).
Fetches a participant by identity. Requires :room and :identity.
Lists participants in a room. Requires :room.
Lists active rooms. Pass :names to filter by room name.
Moves a participant to another room (cloud-only).
Mutes or unmutes a published track. Requires :room, :identity,
:track_sid, and :muted.
Performs a server-side RPC against a participant in a room.
Removes a participant from a room. Requires :room and :identity.
Sends data over the data channel to participants in a room.
Updates participant metadata, permissions, name, or attributes.
Updates room metadata. Requires :room and :metadata.
Subscribes or unsubscribes a participant from tracks.
Functions
@spec create_room( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.Room.t()} | {:error, LiveKit.Error.t()}
Creates a room with the given settings.
Requires :name. Optional fields: :room_preset, :empty_timeout,
:departure_timeout, :max_participants, :node_id, :metadata, :tags,
:egress, :min_playout_delay, :max_playout_delay, :sync_streams,
:replay_enabled, :agents.
@spec delete_room( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.DeleteRoomResponse.t()} | {:error, LiveKit.Error.t()}
Deletes a room by name. Requires :room.
@spec forward_participant( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.ForwardParticipantResponse.t()} | {:error, LiveKit.Error.t()}
Forwards a participant's tracks to another room (cloud-only).
Requires :room, :identity, and :destination_room.
@spec get_participant( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.ParticipantInfo.t()} | {:error, LiveKit.Error.t()}
Fetches a participant by identity. Requires :room and :identity.
@spec list_participants( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.ListParticipantsResponse.t()} | {:error, LiveKit.Error.t()}
Lists participants in a room. Requires :room.
@spec list_rooms( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.ListRoomsResponse.t()} | {:error, LiveKit.Error.t()}
Lists active rooms. Pass :names to filter by room name.
@spec move_participant( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.MoveParticipantResponse.t()} | {:error, LiveKit.Error.t()}
Moves a participant to another room (cloud-only).
Requires :room, :identity, and :destination_room.
@spec mute_published_track( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.MuteRoomTrackResponse.t()} | {:error, LiveKit.Error.t()}
Mutes or unmutes a published track. Requires :room, :identity,
:track_sid, and :muted.
@spec perform_rpc( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.PerformRpcResponse.t()} | {:error, LiveKit.Error.t()}
Performs a server-side RPC against a participant in a room.
Requires :room, :destination_identity, :method, and :payload.
Optional: :response_timeout_ms.
@spec remove_participant( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.RemoveParticipantResponse.t()} | {:error, LiveKit.Error.t()}
Removes a participant from a room. Requires :room and :identity.
Optional: :revoke_token_ts.
@spec send_data( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.SendDataResponse.t()} | {:error, LiveKit.Error.t()}
Sends data over the data channel to participants in a room.
Requires :room, :data, and :kind. Optional: :destination_sids,
:destination_identities, :topic, :nonce.
When :nonce is omitted, a 16-byte random nonce is generated so receivers can
de-dupe messages.
@spec update_participant( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.ParticipantInfo.t()} | {:error, LiveKit.Error.t()}
Updates participant metadata, permissions, name, or attributes.
Requires :room and :identity. Optional: :metadata, :permission,
:name, :attributes.
@spec update_room_metadata( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.Room.t()} | {:error, LiveKit.Error.t()}
Updates room metadata. Requires :room and :metadata.
@spec update_subscriptions( LiveKit.Client.t(), keyword() ) :: {:ok, LiveKit.Proto.UpdateSubscriptionsResponse.t()} | {:error, LiveKit.Error.t()}
Subscribes or unsubscribes a participant from tracks.
Requires :room, :identity, and :subscribe. Optional: :track_sids,
:participant_tracks.