POST/live/sessions

Create session

Create a Live WebRTC session or place an outbound SIP call. Start with the Live prompting guide for session configuration and Telephony and SIP for trunk setup and call monitoring.

Set transport.type to webrtc and supply an SDP offer, or set it to sip and supply an E.164 destination and trunk credentials. Outbound SIP calling must be enabled for your organization. Ringing is limited to 3 minutes and connected calls to 2 hours; these limits are not configurable in the request.

Returns 201 Created after session initialization. WebRTC responses include an SDP answer. SIP responses do not wait for the callee to answer. Attach a sideband connection using session.id to monitor SIP call progress.

Each SIP request creates a new call. If a request times out or the connection fails, retry with caution: the original request may have succeeded, and a retry can place another call.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 body fields
sessionobjectrequired
Startup configuration for the Live session.
transportobjectrequired
WebRTC transport with an SDP offer, or SIP transport with a destination and per-call trunk credentials.

8 status codes
201Returns 201 Created with a WebRTC answer or an initialized outbound SIP session. A SIP response does not mean the callee has answered.
sessionobjectrequired
The newly created Live session. Use its ID for session controls and sideband connections.
transportobjectrequired
WebRTC transport with an SDP answer, or SIP transport without SDP or trunk credentials. For SIP, attach a sideband using session.id to receive transport.ringing, transport.answered, and transport.failed notifications.
400Invalid Live session request.
errorobjectrequired
413The Live session request exceeds the supported size limit.
errorobjectrequired
429The session could not start because a rate or quota limit was exceeded.
errorobjectrequired
500An internal error occurred. The response body is plain text.
502The SIP gateway could not initialize the outbound call.
503The session is temporarily unavailable.
errorobjectrequired
504SIP session initialization timed out. The error code is sip_setup_timeout.
errorobjectrequired

Error handling

A 400 is returned: Invalid Live session request. A 413 is returned: The Live session request exceeds the supported size limit. A 429 is returned: The session could not start because a rate or quota limit was exceeded. A 500 is returned: An internal error occurred. The response body is plain text. A 502 is returned: The SIP gateway could not initialize the outbound call. A 503 is returned: The session is temporarily unavailable. A 504 is returned: SIP session initialization timed out. The error code is sip_setup_timeout.