06 Line
API

Open a WebRTC session

Exchanges an SDP offer for an answer, the way WHIP does. The offer holds one audio transceiver (`sendrecv`) and one data channel labelled `06line`, with every ICE candidate already gathered (no trickle ICE). Use the `ice_servers` returned with the ephemeral key. The session lives as long as the peer connection: it carries the audio of the calls placed or answered with its `id`, one at a time, and pushes `call.incoming`, `call.state` and `line.state` on the data channel. Audio is G.711 (PCMU or PCMA), 8 kHz.

POST
/v1/webrtc/sessions

Exchanges an SDP offer for an answer, the way WHIP does. The offer holds one audio transceiver (sendrecv) and one data channel labelled 06line, with every ICE candidate already gathered (no trickle ICE). Use the ice_servers returned with the ephemeral key.

The session lives as long as the peer connection: it carries the audio of the calls placed or answered with its id, one at a time, and pushes call.incoming, call.state and line.state on the data channel. Audio is G.711 (PCMU or PCMA), 8 kHz.

Authorization

headerAuthorizationBearer <token>

Your API key, 06l_…. For servers only.

Request Body

application/json
  1. body
sdp*string

SDP offer.

Response Body

Session open.

application/json
  1. response
id*SessionId

A WebRTC session, from POST /v1/webrtc/sessions.

Match^rtc_[0-9a-z]{26}$
sdp*string

SDP answer, audio PCMU or PCMA.

Example Request
curl -X POST 'https://api.06line.com/v1/webrtc/sessions' \  -H 'Content-Type: application/json' \  -d '{  "sdp": "v=0\r\no=- 4611731400430051336 2 IN IP4 127.0.0.1\r\n..."}'
Example Response
{  "id": "rtc_01jbq9h7r3m5x1k8t2v6c4d0ya",  "sdp": "v=0\r\no=- 1902398745 2 IN IP4 0.0.0.0\r\n..."}