Expand description
Rust server SDK for the VideoSDK v2 REST APIs.
§Getting started
Construct a Client from your project credentials. It reads
VIDEOSDK_API_KEY and VIDEOSDK_SECRET from the environment when they are
not passed explicitly.
let client = videosdk::Client::builder()
.api_key("my-key")
.secret("my-secret")
.build()?;§Authentication
The client mints a short-lived HS256 JWT from your key and secret, attaches it to every request, and refreshes it before it expires. Signing happens locally — nothing is sent anywhere to authenticate. You never construct a token or set a header yourself.
To mint a token for a participant — to hand to a client-side SDK — use
Client::access_token:
let token = client
.access_token()?
.set_participant("participant-1")
.grant(Grant::AllowJoin)
.for_room("room-1")
.expires_in(Duration::from_secs(2 * 60 * 60))
.to_jwt()?;§Optional parameters
Request parameters are plain structs whose optional fields are Option<T>.
Build them with struct-update syntax:
let params = ListRoomsParams {
page: Some(2),
..Default::default()
};§Errors
Every call returns Result<T>. Match on Error, or use the predicates:
match result {
Ok(room) => println!("{room}"),
Err(err) if err.is_not_found() => println!("no such room"),
Err(err) => eprintln!("failed: {err}"),
}§Retries
Requests are retried up to ClientBuilder::max_retries times (2 by
default) with exponential backoff and jitter. A 429 is always retried, and
honors the server’s Retry-After. Network errors, timeouts and 5xx
responses are retried only for idempotent methods, so a POST is never
replayed.
§Pagination
List endpoints return a Page. Walk it by hand with Page::next_page,
or stream every item across every page with Page::into_stream.
Structs§
- Absent
Data Alert - Alerts when a metric stops reporting data.
- Access
Token Builder - Fluently builds a VideoSDK access token.
- Acquire
Resource Params - The parameters for
ResourcePoolResource::acquire. - Agent
Compute Profile - The compute profile of a deployment version.
- Agent
Deployment - A cloud agent deployment.
- Agent
Deployment Resource - Cloud agent deployments. Reached via
AgentsResource::deployment. - Agent
Deployment Version - A deployment version.
- Agent
Init Config - The registry configuration a worker uses to initialize.
- Agent
LogEntry - A single console-log entry.
- Agent
Room Options - Per-dispatch room behavior.
- Agent
Scaling - The replica scaling of a deployment.
- Agents
Resource - Dispatches deployed agents into rooms. Reached via
Client::agents. - Alert
Condition Operator - The comparison operator in an alert rule condition.
- Alert
Domain - The product domain an alert rule is scoped to.
- Alert
Match Type - How a condition must be met over the evaluation window.
- Alert
Reduce To - Collapses each series to a single value before the threshold check.
- Alert
Rule - A configured alert rule.
- Alert
Rule Condition - Compares the query’s aggregated value against a threshold.
- Alert
Rule Config - An alert rule’s config: a metric
queryand a thresholdcondition(both required), plus optional evaluation, absent-data alerting, and a formula overadditional_queries. - Alert
Rule Evaluation - Controls how often and over what window the rule runs.
- Alert
Rule Filter - Narrows a metric query.
valueis a string, number, or array of them. - Alert
Rule Group By - Groups a metric query by an attribute key.
- Alert
Rule Having - Filters on an aggregated column.
- Alert
Rule Query - Selects and aggregates a metric to alert on.
- Alert
Rule Status - Whether an alert rule is active or paused.
- Alert
Rules Resource - The alert-rules API. Reached via
Client::alert_rules. - Alert
Severity - An alert rule’s severity.
- Api
- The raw HTTP escape hatch, reachable via
Client::api. - ApiError
- An error returned by the API as a non-2xx HTTP response.
- Auto
Close Config - The auto-close behavior of a room’s session, as carried on a
Room. - Auto
Close Config Input - The auto-close behavior for a room’s session.
- Auto
Close Type - What happens when a room’s session ends.
- Auto
Start Config - Compositions to start automatically when a session begins.
- Batch
Call - A bulk outbound phone campaign.
- Batch
Call Cancel Mode - How a batch is cancelled.
- Batch
Call Record - A single per-number record in a batch.
- Batch
Call Records Resource - A batch’s per-number records. Reached via
BatchCallsResource::records. - Batch
Call Retry Config - Configures retries for a batch.
- Batch
Call Retry Status - A call status that can trigger a retry.
- Batch
Call Stats - A status breakdown for a batch.
- Batch
Call Status - A batch’s lifecycle state.
- Batch
Call Timing - When a batch runs.
- Batch
Call Webhook Config - Configures a batch’s webhook.
- Batch
Call Webhook Event - A batch-call webhook event.
- Batch
Calls Resource - Bulk outbound phone campaigns. Reached via
Client::batch_call. - Client
- The VideoSDK server SDK client.
- Client
Builder - Builds a
Client. - Composer
Type - The composer type a unit is acquired for.
- Composite
Participant Selector - Selects a participant, and optionally which of their tracks, to compose.
- Composite
Recording - A server-side composed recording.
- Composite
Recording List Params - The query parameters for
RecordingCompositeResource::list. - Composite
Recording Start Params - The parameters for
RecordingCompositeResource::start. - Composite
Watermark - A watermark applied to a composite recording.
- Composition
- The composition options shared by every egress: layout, priority, grid size, orientation, theme and quality.
- Composition
Config - The wire composition configuration, shared by recording, HLS and livestream.
- Connector
- A per-provider telephony webhook ingress.
- Connector
Provider - A telephony provider.
- Connectors
Resource - Telephony connectors. Reached via
Client::connectors. - Create
Alert Rule Params - The parameters for
AlertRulesResource::create. - Create
Batch Call Params - The parameters for
BatchCallsResource::create. - Create
Connector Params - The parameters for
ConnectorsResource::create. - Create
Inbound Trunk Params - The parameters for
InboundTrunkResource::create. - Create
Outbound Trunk Params - The parameters for
OutboundTrunkResource::create. - Create
Phone Numbers Params - The parameters for
PhoneNumbersResource::create. - Create
Routing Rule Params - The parameters for
SipRoutingRulesResource::create. - Create
SipCall Params - The parameters for
SipCallsResource::create. - Create
SipWebhook Params - The parameters for creating or updating a SIP webhook.
- Create
Socket Ingress Params - The parameters for
SocketIngressResource::create. - Create
Whep Params - The parameters for
WhepResource::create. - Create
Whip Params - The parameters for
WhipResource::create. - Delete
Records Result - The result of a bulk record deletion.
- Deploy
Agent Params - The parameters for
AgentDeploymentResource::create. - Deploy
Image - A container image for a deployment version.
- Deployed
Agent - The result of
AgentDeploymentResource::create. - Dispatch
Agent Params - The parameters for
AgentsResource::dispatchandconnect. - Dispatch
Result - The result of dispatching an agent.
- Egress
Handle - A handle to a running egress.
- Export
Batch Call Records Params - The query parameters for
BatchCallRecordsResource::export. - General
Dispatch Agent Params - The parameters for
AgentsResource::general_dispatch, a managed or low-code dispatch. Unlike the others, this ignoresversion_tagandwait. - Generate
Token Params - Configures
generate_token. - HlsCapture
Params - The parameters for
HlsResource::capture. - HlsCapture
Result - The result of
HlsResource::capture. - HlsList
Params - The query parameters for
HlsResource::list. - HlsResource
- The HLS API. Reached via
Client::hls. - HlsStart
Params - The parameters for
HlsResource::start. - HlsStream
- An HLS stream, or a finished HLS recording.
- HlsTo
Mp4Params - The parameters for
TranscodingsResource::hls_to_mp4. - Inbound
Trunk Resource - Inbound SIP trunks: connections that receive calls for a set of numbers.
Reached via
SipTrunksResource::inbound. - Individual
Recording - A participant recording, or its per-track variant.
- Individual
Recording List Params - The query parameters for the participant and track recording lists.
- Layout
Config - The wire layout configuration of a composition.
- List
Alert Rules Params - The query parameters for
AlertRulesResource::list. - List
Batch Call Records Params - The query parameters for
BatchCallRecordsResource::list. - List
Batch Calls Params - The query parameters for
BatchCallsResource::list. - List
Deployment Logs Params - The query parameters for
AgentDeploymentResource::logs. - List
Deployments Params - The query parameters for
AgentDeploymentResource::list. - List
Params - The pagination query parameters common to every list endpoint.
- List
Realtime Transcriptions Params - The query parameters for
RealtimeTranscriptionResource::list. - List
Resources Params - The query parameters for
ResourcePoolResource::list. - List
Transcodings Params - The query parameters for
TranscodingsResource::list. - Livestream
- An RTMP-out livestream.
- Meeting
Recording Merge Params - The parameters for
TranscodingsResource::meeting_recording_merge. - Meeting
Recording Ref - A recording reference for a meeting-recording merge.
- Merge
Channel - A single channel entry on a merge recording.
- Merge
Channel Entry - One source in a merge channel.
- Merge
Recording - A merged stereo-audio recording.
- Merge
Recording Create Params - The parameters for
MergeRecordingResource::create. - Merge
Recording List Params - The query parameters for
MergeRecordingResource::list. - Merge
Recording Resource - Muxes individual recordings into stereo channels. Reached via
RecordingsResource::merge. - Merge
Recording Result - The result of starting a merge job.
- Merge
Transcoding Params - The parameters for
TranscodingsResource::merge. - Message
Response - The plain
{message}body returned by many action and delete endpoints. - Method
- The Request Method (VERB)
- Multi
Composition - Independently starts multiple compositions of the same type.
- OnFailure
Config - The behavior applied when a composition fails.
- Outbound
Trunk Resource - Outbound SIP trunks: connections used to place calls to a SIP host. Reached
via
SipTrunksResource::outbound. - Page
- A page of list results.
- Page
Info - Normalized pagination metadata, consistent across every list endpoint.
- Participant
- A participant within a session.
- Participant
Recording Start Params - The parameters for
RecordingParticipantResource::start. - Participant
Timelog - A single join/leave interval for a participant.
- Participants
Resource - A room-keyed view over a room’s live participants. Reached via
Client::participants. - Phone
Number Inbound Config - Configures a phone number’s inbound gateway.
- Phone
Number Info - A provisioned phone number.
- Phone
Number List Params - The query parameters for
PhoneNumbersResource::list. - Phone
Number Outbound Config - Configures a phone number’s outbound gateway.
- Phone
Number With Gateways - A phone number with the gateways attached to it.
- Phone
Numbers Resource - Provisioned phone numbers. Reached via
SipResource::phone_numbers. - RawRequest
- Configures a raw
ApiorClient::requestcall. - Realtime
Summary Config - A post-transcription summary configuration.
- Realtime
Transcription - A realtime transcription job. Its
idis the transcription id. - Realtime
Transcription Extension - The extension sub-object on a realtime transcription.
- Realtime
Transcription Extension Config - The nested configuration of a realtime transcription’s extension.
- Realtime
Transcription Resource - Live transcription against a room’s active session. Reached via
TranscriptionResource::realtime. - Recording
- A composited room recording.
- Recording
Composite Resource - Records a server-side composed mix. Reached via
RecordingsResource::composite. - Recording
File - A produced recording or output file.
- Recording
GetParams - The parameters for
RecordingsResource::get. - Recording
List Params - The query parameters for
RecordingsResource::list. - Recording
Participant Resource - Records individual participants. Reached via
RecordingsResource::participant. - Recording
Start Params - The parameters for
RecordingsResource::start, a room recording. - Recording
Track Resource - Records individual tracks. Reached via
RecordingsResource::track. - Recordings
Resource - The recordings API. Reached via
Client::recordings. - Region
- A VideoSDK region code, accepted as a room’s geo-fence.
- Release
Resource Result - The outcome of releasing a single unit.
- Resource
Mode - A unit’s capture mode.
- Resource
Pool Resource - The resource pool. Reached via
Client::resource_pool. - Resource
Quality - A unit’s output quality.
- Resource
Status - A composition unit’s status.
- Resource
Unit - A pre-acquired composition resource unit.
- Room
- A room, a.k.a. a “meeting”: a durable id that hosts live sessions.
- Room
Create Params - The parameters for
RoomsResource::create. - Room
List Params - The query parameters for
RoomsResource::list. - Room
Validation - The result of
RoomsResource::validate. - Room
Webhook - A room-level webhook subscription, as carried on a
Room. - Room
Webhook Input - Subscribes a room to its session events.
- Rooms
Resource - The rooms (meetings) API. Reached via
Client::rooms. - Rtmp
List Params - The query parameters for
RtmpResource::list. - Rtmp
Resource - The RTMP-out API: push a room to RTMP destinations. Reached via
Client::rtmp. - Rtmp
Start Params - The parameters for
RtmpResource::start. - Rtmp
Stream - An RTMP destination.
- Session
- A session: a single live occupancy of a room.
- Session
EndParams - The parameters for
SessionsResource::end. - Session
List Params - The query parameters for
SessionsResource::list. - Session
Remove Participant Params - The parameters for
SessionsResource::remove_participant. - Session
Status - A session’s lifecycle state.
- Sessions
Resource - The sessions API. Reached via
Client::sessions. - SipAuth
- SIP credentials.
- SipCall
- A SIP call.
- SipCall
List Params - The query parameters for
SipCallsResource::list. - SipCall
Status - A call’s lifecycle status.
- SipCalls
Resource - SIP calls. Reached via
SipResource::calls. - SipDirection
- A routing-rule or call direction.
- SipInclude
Headers - Which SIP headers to forward.
- SipMedia
Encryption - Whether media is encrypted.
- SipRegion
- A SIP-capable region.
- SipResource
- The SIP / telephony API. Reached via
Client::sip. - SipRoom
Config - The destination-room configuration of a routing rule, as it appears on the wire.
- SipRoom
Prefix - How a per-call room id is generated. A strategy, not a literal prefix.
- SipRoom
Type - How a routing rule allocates its destination room.
- SipRouting
Rule - A routing rule, binding provisioned phone numbers to a dispatch target.
- SipRouting
Rule List Params - The query parameters for
SipRoutingRulesResource::list. - SipRouting
Rules Resource - SIP routing rules. Reached via
SipResource::routing_rules. - SipTransport
- A SIP transport protocol.
- SipTrunk
- An inbound or outbound SIP trunk.
- SipTrunk
List Params - The query parameters for listing trunks.
- SipTrunks
Resource - Groups the inbound and outbound trunk sub-resources. Reached via
SipResource::trunks. - SipWebhook
- A webhook delivering SIP call-event notifications.
- SipWebhook
Event - A SIP call-lifecycle webhook event.
- SipWebhook
List Params - The query parameters for
SipWebhooksResource::list. - SipWebhooks
Resource - SIP webhooks. Reached via
SipResource::webhooks. - Socket
Ingress - A socket-ingest session.
- Socket
Ingress Agent - Agent metadata to associate with an ingest session.
- Socket
Ingress Resource - Streams media and data frames into a room over a single-use WebSocket. To
tear down, close the socket; the URL also expires on its own. Reached via
Client::socket_ingress. - Start
Realtime Transcription Params - The parameters for
RealtimeTranscriptionResource::start. - Stop
Target - What to stop: an
EgressHandle, or a bare room id. - Summary
Config - A post-call AI summary configuration. Requires transcription to be enabled.
- Switch
Room Params - The parameters for
SipCallsResource::switch_room. - Token
Claims - A decoded view of a token payload.
- Token
Options - Overrides applied to every token the client mints for its own requests.
- Track
Recording Start Params - The parameters for
RecordingTrackResource::start. - Transcoding
- A transcoding job.
- Transcoding
File - A transcoding job’s output file.
- Transcoding
Status - A transcoding job’s lifecycle state.
- Transcoding
Storage - The output storage target of an HLS-to-MP4 transcoding.
- Transcoding
Task - A transcoding job kind.
- Transcoding
Watermark - A watermark applied to a merge transcoding.
- Transcodings
Resource - Transcoding jobs. Reached via
Client::transcodings. - Transcription
Config - A real-time transcription configuration.
- Transcription
Resource - The transcription API. Reached via
Client::transcription. - Transfer
SipCall Params - The parameters for
SipCallsResource::transfer. - Update
Alert Rule Params - The parameters for
AlertRulesResource::update. Only the set fields change. - Update
Batch Call Params - The editable fields of a batch: draft, scheduled or parsed.
- Update
Batch Call Record Params - The editable fields of a pending record.
- Update
Inbound Trunk Params - The parameters for
InboundTrunkResource::update. - Update
Outbound Trunk Params - The parameters for
OutboundTrunkResource::update. The same reset semantics asUpdateInboundTrunkParamsapply. - Update
Phone Number Gateway Params - The parameters for
PhoneNumbersResource::update_gateway. - Update
Routing Rule Params - The parameters for
SipRoutingRulesResource::update. A rule’s direction is fixed at creation and cannot be changed. - Upload
Batch Call Params - The parameters for
BatchCallsResource::upload. - Webhook
Delivery - A single webhook delivery attempt.
- Webhook
Delivery Summary - A summary of a resource’s webhook delivery attempts.
- Whep
Playback - A WHEP playback credential.
- Whep
Resource - WHEP egress: standards-based WebRTC pull from a room. Requires an active
session. Reached via
Client::whep. - Whep
Source - Selects the remote participant a WHEP subscriber pulls.
- Whip
Ingress - A WHIP ingest credential.
- Whip
Resource - WHIP ingress: WebRTC-HTTP publish into a room. Reached via
Client::whip.
Enums§
- Agent
Image - A container image for a deployment: either a reference string, or a full
DeployImage. - Composition
Layout - A composition layout: one of the named layouts, or a custom template.
- Composition
Quality - A recorder quality tier.
- Egress
Type - The kind of egress an
EgressHandlerefers to. - Error
- The error type returned by every fallible SDK call.
- Error
Kind - A coarse classification of an
Error. - Expect
- What the caller expects the response body to be.
- Grant
- A participant permission claim — an entry in the token’s
permissions. - HlsCapture
Format - The image format of a thumbnail capture.
- Layout
Priority - Which participant a layout prioritizes.
- Layout
Type - A composition layout style, as it appears on the wire.
- Orientation
- A composition’s orientation.
- Participant
File Format - The file format of a participant recording.
- Recording
File Format - The file format of a room or composite recording.
- Routing
Rule Target - Where a routing rule sends the caller.
- Theme
- A composition’s theme.
- Track
File Format - The file format of a track recording.
- Track
Kind - The media kind of a track recording.
- Value
- Represents any valid JSON value.
Constants§
- DEFAULT_
BASE_ URL - The production API endpoint.
- DEFAULT_
TOKEN_ TTL - The token lifetime used when none is specified.
- VERSION
- This SDK’s version, reported in the
User-Agentheader of every request.
Functions§
- decode_
token - Decodes a token’s payload without verifying its signature.
- generate_
token - Signs a JWT for authenticating against the VideoSDK v2 REST APIs.
- parse_
expires_ in - Converts a duration string such as
"30s","10m","24h","7d","2w"or"1y"into aDuration. A bare number is interpreted as seconds. - verify_
token - Verifies an HS256 JWT against
secretand returns its claims.
Type Aliases§
- Quality
Stats - A loosely-typed quality-of-service statistics payload.
- Resource
Links - HATEOAS-style links returned on many resources.
- Result
- A convenience alias for a
Resultwhose error is the SDK’sError.