Namespace Livekit.Server.Sdk.Dotnet
Access tokens, webhooks and clients of the LiveKit server APIs, for a .NET backend.
- AccessToken signs the tokens participants join rooms with; VideoGrants and SIPGrants say what they may do.
- RoomServiceClient, EgressServiceClient, IngressServiceClient, SipServiceClient, AgentDispatchServiceClient and ConnectorServiceClient call the server APIs.
- WebhookReceiver verifies and parses the webhooks LiveKit posts.
- TwirpException is the error of a failed service call.
The other types of this namespace are the protobuf messages of the requests, responses and events, generated from livekit/protocol.
Classes
- AccessToken
Access tokens are required to connect to the server. Once information is filled out, create the token string with ToJwt(). See Access tokens and grants.
- AgentDispatchServiceClient
Client of the LiveKit Agent Dispatch service: dispatches agents to rooms explicitly, lists and deletes those dispatches.
- AgentHttp
----- agent HTTP endpoints data plane -----
AgentHttp namespaces the data plane: workers expose HTTP endpoints served at /agents/{agent_name}/{deployment}/{path} without binding any local listener. The worker opens ONE WebTransport (QUIC) session to /agent that carries both its control stream (the same WorkerMessage/ServerMessage exchange as the WebSocket control connection, length-delimited) and every HTTP exchange: the node opens one bidirectional QUIC stream per request. QUIC provides the multiplexing and per-stream flow control, so there is no credit accounting and no attach handshake.
Each exchange stream is:
[len:u32be][StreamPreamble] the only LiveKit framing [ ... opaque bytes ... ] one HTTP/1.1 exchange, to FIN or RESET_STREAM
After the preamble the stream is byte-transparent: the node writes a canonical HTTP/1.1 request and the worker replies with an HTTP/1.1 response, each parsed by whatever HTTP implementation the side already has. A WebSocket upgrade is therefore an ordinary request whose response is a 101, after which the stream is a byte pipe. The protocol evolves by version negotiation at registration, so the preamble carries no version of its own.
Bodies use ordinary HTTP/1.1 framing, Content-Length or chunked, and are unbounded: a body may be many gigabytes and must be streamed. Request and response size limits are policy for the layer above.
How one direction ends:
success end of message per the body's own framing, then FIN. failed mid-body chunked trailer fields x-lk-completion and x-lk-error, in band, so the outcome cannot race the bytes it describes. failed before any RESET_STREAM carrying an HttpStreamResetCode, sound bytes only here, where nothing is in flight.
FIN before the body's own framing says it is complete is truncation, and a receiver must surface it as such.
The x-lk- header prefix is reserved for this signalling in both directions. A node strips it from client-supplied request headers, so a client cannot forge one, and strips it from responses, so it never reaches the end client.
- AgentHttp.Types
Container for nested types declared in the AgentHttp message type.
- AgentHttp.Types.AgentEndpointSettings
registration-level settings negotiated on the control connection, returned in RegisterWorkerResponse when the worker declares endpoints and the server supports the data plane.
- AgentHttp.Types.GoAway
the server is draining: the worker should re-register elsewhere; in-flight HTTP exchanges run to completion
- AgentHttp.Types.StreamPreamble
the first thing on every exchange stream, node -> worker. It carries only what the worker cannot derive from the HTTP bytes that follow and what it must not infer from client-supplied headers - identity above all.
- AudioConfig
Unified audio selection and channel routing. Each route specifies both which audio to capture and which channel to output to.
- BaseService
Base class of the service clients: holds the credentials and the HttpClient, signs every call with a short-lived token and sends it as a Twirp request.
- ClaimsModel
All the claims of an access token, as built by AccessToken and read back by Verify(string).
- ClientConfiguration
server provided client configuration
- ClientInfo
details about the client
- ClientInfo.Types
Container for nested types declared in the ClientInfo message type.
- ConnectTwilioCallRequest.Types
Container for nested types declared in the ConnectTwilioCallRequest message type.
- ConnectorServiceClient
A client for interacting with the Connector service, which connects WhatsApp and Twilio calls to LiveKit rooms. Only available in LiveKit Cloud.
- Constants
Default values shared by the SDK.
- CreatePrivateLinkRequest.Types
Container for nested types declared in the CreatePrivateLinkRequest message type.
- CreateSIPParticipantRequest
A SIP Participant is a singular SIP session connected to a LiveKit room via a SIP Trunk into a SIP DispatchRule
- DataBlob
A blob of data stored in a room identified by a unique key.
- DataBlobKey
Key used to uniquely identify a data blob for storage and retrieval.
- DataPacket
new DataPacket API
- DataPacket.Types
Container for nested types declared in the DataPacket message type.
- DataStream.Types
Container for nested types declared in the DataStream message type.
- DataStream.Types.ByteHeader
header properties specific to byte or file streams
- DataStream.Types.Header
main DataStream.Header that contains a oneof for specific headers
- DataStream.Types.TextHeader
header properties specific to text streams
- DataTrackFrameEncoding
Encoding for frame payloads.
- DataTrackFrameEncoding.Types
Container for nested types declared in the DataTrackFrameEncoding message type.
- DataTrackSchemaEncoding
Encoding for schema definition.
- DataTrackSchemaEncoding.Types
Container for nested types declared in the DataTrackSchemaEncoding message type.
- DataTrackSchemaId
Identifier for a data track schema.
Schemas with the same name but different encodings are distinct.
- DataTrackSubscriberHandles.Types
Container for nested types declared in the DataTrackSubscriberHandles message type.
- DependencyDescriptorForwarderState
State of a forwarder that writes the dependency descriptor for the subscriber, so its frame numbers continue on a migrated subscriber.
- DisconnectWhatsAppCallRequest.Types
Container for nested types declared in the DisconnectWhatsAppCallRequest message type.
- EgressServiceClient
Client of the LiveKit Egress service: records or streams rooms, participants, tracks and web pages. See Egress overview.
- Encryption.Types
Container for nested types declared in the Encryption message type.
- FeatureUsageInfo.Types
Container for nested types declared in the FeatureUsageInfo message type.
- FileOutput
Unified file output — replaces v1 EncodedFileOutput and DirectFileOutput. Whether transcoded depends on encoding options on the request.
- GetPhoneNumberRequest
GetPhoneNumberRequest - Request to get a phone number
- GetPhoneNumberResponse
GetPhoneNumberResponse - Response containing the phone number
- ImageOutput
Capture images at a specified interval
- InferenceGrants
The
inferencegrant of an access token.
- IngressServiceClient
Client of the LiveKit Ingress service: brings RTMP, WHIP or URL media into rooms. See Ingress overview.
- IngressState.Types
Container for nested types declared in the IngressState message type.
- JobJoinTiming
Instants of one agent join on the worker host's monotonic clock, in microseconds. The clock origin is arbitrary, so only differences between these values carry meaning on their own. The worker and its job processes share this clock.
- LeaveRequest.Types
Container for nested types declared in the LeaveRequest message type.
- ListPhoneNumbersRequest
ListPhoneNumbersRequest - Request to list phone numbers
- ListPhoneNumbersResponse
ListPhoneNumbersResponse - Response containing phone numbers
- ListSIPDispatchRuleRequest
ListSIPDispatchRuleRequest lists dispatch rules for given filters. If no filters are set, all rules are listed.
- ListSIPInboundTrunkRequest
ListSIPInboundTrunkRequest lists inbound trunks for given filters. If no filters are set, all trunks are listed.
- ListSIPOutboundTrunkRequest
ListSIPOutboundTrunkRequest lists outbound trunks for given filters. If no filters are set, all trunks are listed.
- ListUpdate
ListUpdate is used for updated APIs where 'repeated string' field is modified.
- MediaSource
Capture tracks directly from a room via SDK. Unifies deprecated Participant, TrackComposite, and Track egress.
- NodeStatsRate
rates of different node stats (per second)
- ObservabilityGrants
The
observabilitygrant of an access token.
- ParticipantInfo.Types
Container for nested types declared in the ParticipantInfo message type.
- PhoneNumber
PhoneNumber - Unified phone number type for inventory and purchased numbers
- PrivateLink.Types
Container for nested types declared in the PrivateLink message type.
- PrivateLinkStatus.Types
Container for nested types declared in the PrivateLinkStatus message type.
- PurchasePhoneNumberRequest
PurchasePhoneNumberRequest - Request to purchase phone numbers
- PurchasePhoneNumberResponse
PurchasePhoneNumberResponse - Response containing the purchased phone numbers
- ReleasePhoneNumbersRequest
ReleasePhoneNumbersRequest - Request to release phone numbers
- ReleasePhoneNumbersResponse
ReleasePhoneNumbersResponse - Response for releasing phone numbers
- RequestResponse.Types
Container for nested types declared in the RequestResponse message type.
- RoomInternal
room info that should not be returned to clients
- RoomServiceClient
Client of the LiveKit Room service: creates, lists and deletes rooms and manages their participants, tracks and data messages.
- SIPGrants
The
sipgrant of an access token: what its holder may do with the SIP service.
- SIPStatus
SIPStatus is returned as an error detail in CreateSIPParticipant.
- SIPTransferError
Details of a failed SIP transfer, attached to the error.
- SIPTrunkInfo.Types
Container for nested types declared in the SIPTrunkInfo message type.
- SearchPhoneNumbersRequest
SearchPhoneNumbersRequest - Request to search available phone numbers
- SearchPhoneNumbersResponse
SearchPhoneNumbersResponse - Response containing available phone numbers
- SegmentedFileOutput
Used to generate HLS segments or other kind of segmented output
- ServerInfo
details about the server
- ServerInfo.Types
Container for nested types declared in the ServerInfo message type.
- ServerMessage
from Server to Worker
- SipServiceClient
Client of the LiveKit SIP service: inbound and outbound trunks, dispatch rules and SIP participants (outbound calls, transfers).
- StreamInfo.Types
Container for nested types declared in the StreamInfo message type.
- TemplateSource
Room composite recording via layout template. Service generates token, constructs recorder URL, awaits start signal.
- TokenVerifier
Helper to verify the integrity of a token.
- TransferSIPParticipantResponse
Added in https://github.com/livekit/protocol/pull/1730. Not needed after all: will be rolled back to an empty message once STR_CALL_ENDED is reported as an error like every other failed transfer.
- TwirpException
Error returned by the LiveKit server for a service call. It derives from the generated
Twirp.Exception, so existingcatchblocks keep working, and adds the HTTP status and themetamap of the Twirp error (for examplesip_status_codefor SIP calls). The Twirp error code is in the inheritedTypeproperty.
- UpdateDataSubscription.Types
Container for nested types declared in the UpdateDataSubscription message type.
- UpdatePhoneNumberRequest
UpdatePhoneNumberRequest - Request to update a phone number
- UpdatePhoneNumberResponse
UpdatePhoneNumberResponse - Response containing the updated phone number
- UpdateSubscriptionsResponse
empty for now
- UpdateVideoLayers
message to indicate published video track dimensions are changing
- VideoGrants
The
videogrant of an access token: what its holder may do in rooms.
- VideoLayer
provide information about available spatial layers
- VideoLayer.Types
Container for nested types declared in the VideoLayer message type.
- WebSource
Record a custom URL via headless browser.
- WebhookReceiver
Receives the webhook events LiveKit posts: verifies the token of the
Authorizationheader and the SHA-256 of the body, then parses the WebhookEvent.
- WorkerMessage
from Worker to Server
- WrappedJoinRequest.Types
Container for nested types declared in the WrappedJoinRequest message type.
Enums
- APICallRequest.MessageOneofCase
Enum of possible cases for the "message" oneof.
- AgentDispatchTrigger
what created the dispatch
- AgentHttp.Types.HttpStreamResetCode
why a stream was reset before any HTTP bytes flowed. This travels as the QUIC RESET_STREAM / STOP_SENDING error code, so it is a number with no room for detail: the reason string is logged by the side that reset and joined to this by request_id. An outcome after bytes have flowed travels in trailers instead, where it cannot race them.
- AudioRoute.MatchOneofCase
Enum of possible cases for the "match" oneof.
- AutoParticipantEgress.OptionsOneofCase
Enum of possible cases for the "options" oneof.
- AutoTrackEgress.OutputOneofCase
Enum of possible cases for the "output" oneof.
- BackupCodecPolicy
Policy for publisher to handle subscribers that are unable to support the primary codec of a track
- ClientInfo.Types.Capability
Optional capabilities advertised by the client at connect time. The SFU uses these flags to decide whether to enable features that require client-side support (e.g. passing RTP packet trailers through to the subscriber instead of stripping them).
- CreatePrivateLinkRequest.ConfigOneofCase
Enum of possible cases for the "config" oneof.
- DataBlobKey.KeyOneofCase
Enum of possible cases for the "key" oneof.
- DataPacket.ValueOneofCase
Enum of possible cases for the "value" oneof.
- DataSelector.MatchOneofCase
Enum of possible cases for the "match" oneof.
- DataStream.Types.CompressionType
The compression type of the whole data stream
This will only get populated when send to participants with a client protocol >= 2 which advertise a client capability of CAP_COMPRESSION_DEFLATE_RAW
- DataStream.Types.Header.ContentHeaderOneofCase
Enum of possible cases for the "content_header" oneof.
- DataStream.Types.OperationType
enum for operation types (specific to TextHeader)
- DataTrackFrameEncoding.Types.WellKnownFrameEncoding
Well-known encoding for frame payloads.
Mirrors the well-known message encodings from the MCAP spec: https://mcap.dev/spec/registry#message-encodings
- DataTrackFrameEncoding.ValueOneofCase
Enum of possible cases for the "value" oneof.
- DataTrackSchemaEncoding.Types.WellKnownSchemaEncoding
Well-known encoding for schema definition.
Mirrors the well-known schema encodings from the MCAP spec: https://mcap.dev/spec/registry#schema-encodings
- DataTrackSchemaEncoding.ValueOneofCase
Enum of possible cases for the "value" oneof.
- DirectFileOutput.OutputOneofCase
Enum of possible cases for the "output" oneof.
- EgressInfo.RequestOneofCase
Enum of possible cases for the "request" oneof.
- EgressInfo.ResultOneofCase
Enum of possible cases for the "result" oneof.
- EncodedFileOutput.OutputOneofCase
Enum of possible cases for the "output" oneof.
- EncryptedPacketPayload.ValueOneofCase
Enum of possible cases for the "value" oneof.
- ExportReplayRequest.EncodingOneofCase
Enum of possible cases for the "encoding" oneof.
- ExportReplayRequest.SourceOneofCase
Enum of possible cases for the "source" oneof.
- ImageOutput.OutputOneofCase
Enum of possible cases for the "output" oneof.
- IngressAudioOptions.EncodingOptionsOneofCase
Enum of possible cases for the "encoding_options" oneof.
- IngressVideoOptions.EncodingOptionsOneofCase
Enum of possible cases for the "encoding_options" oneof.
- LeaveRequest.Types.Action
indicates action clients should take on receiving this message
- MediaSource.VideoOneofCase
Enum of possible cases for the "video" oneof.
- MetricLabel
index from [0: MAX_LABEL_PREDEFINED_MAX_VALUE) are for predefined labels (
MetricLabel)
- Output.ConfigOneofCase
Enum of possible cases for the "config" oneof.
- ParticipantEgressRequest.OptionsOneofCase
Enum of possible cases for the "options" oneof.
- PhoneNumberStatus
Phone number status enumeration
- PhoneNumberType
Phone number type enumeration
- PrivateLink.ConfigOneofCase
Enum of possible cases for the "config" oneof.
- RTPForwarderState.CodecMungerOneofCase
Enum of possible cases for the "codec_munger" oneof.
- ReportInfo.MessageOneofCase
Enum of possible cases for the "message" oneof.
- RequestResponse.RequestOneofCase
Enum of possible cases for the "request" oneof.
- RoomCompositeEgressRequest.OptionsOneofCase
Enum of possible cases for the "options" oneof.
- RoomCompositeEgressRequest.OutputOneofCase
Enum of possible cases for the "output" oneof.
- RoomEndReason
why a room ended, reported on room-ended telemetry
- RpcResponse.ValueOneofCase
Enum of possible cases for the "value" oneof.
- SIPDialtone
Dial tone (ringback) played while a call is being placed or transferred. Receivers treat unknown values as SIP_DIALTONE_ETSI.
- SIPDispatchRule.RuleOneofCase
Enum of possible cases for the "rule" oneof.
- SIPNamedDest.UriOneofCase
Enum of possible cases for the "uri" oneof.
- SIPRequestDest.UriOneofCase
Enum of possible cases for the "uri" oneof.
- SegmentedFileOutput.OutputOneofCase
Enum of possible cases for the "output" oneof.
- ServerMessage.MessageOneofCase
Enum of possible cases for the "message" oneof.
- SignalRequest.MessageOneofCase
Enum of possible cases for the "message" oneof.
- SignalResponse.MessageOneofCase
Enum of possible cases for the "message" oneof.
- SimulateScenario.ScenarioOneofCase
Enum of possible cases for the "scenario" oneof.
- StartEgressRequest.EncodingOneofCase
Enum of possible cases for the "encoding" oneof.
- StartEgressRequest.SourceOneofCase
Enum of possible cases for the "source" oneof.
- StorageConfig.ProviderOneofCase
Enum of possible cases for the "provider" oneof.
- TrackCompositeEgressRequest.OptionsOneofCase
Enum of possible cases for the "options" oneof.
- TrackCompositeEgressRequest.OutputOneofCase
Enum of possible cases for the "output" oneof.
- TrackEgressRequest.OutputOneofCase
Enum of possible cases for the "output" oneof.
- UpdateSIPDispatchRuleRequest.ActionOneofCase
Enum of possible cases for the "action" oneof.
- UpdateSIPInboundTrunkRequest.ActionOneofCase
Enum of possible cases for the "action" oneof.
- UpdateSIPOutboundTrunkRequest.ActionOneofCase
Enum of possible cases for the "action" oneof.
- WebEgressRequest.OptionsOneofCase
Enum of possible cases for the "options" oneof.
- WebEgressRequest.OutputOneofCase
Enum of possible cases for the "output" oneof.
- WorkerMessage.MessageOneofCase
Enum of possible cases for the "message" oneof.