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 µ-law (PCMU), 8 kHz, which every WebRTC stack supports; an offer without PCMU gets no audio. Every session of the company hears `call.incoming` (a session of a key restricted to a line, only for its line), right after `session.ready` for a call already ringing, then `call.state` when the call stops ringing. A session closed with `DELETE` ends its call `hangup`; a session lost on the way (ICE failed) ends it `failed`.

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 µ-law (PCMU), 8 kHz, which every WebRTC stack supports; an offer without PCMU gets no audio.

Every session of the company hears call.incoming (a session of a key restricted to a line, only for its line), right after session.ready for a call already ringing, then call.state when the call stops ringing. A session closed with DELETE ends its call hangup; a session lost on the way (ICE failed) ends it failed.

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.

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..."}