06 Line
API

Create an ephemeral key

Creates a short-lived key (15 minutes) that a browser uses instead of your API key, with the ICE servers it needs for WebRTC. Call it from your server, then hand the response to the browser. An ephemeral key can list lines, open and close WebRTC sessions, place, answer, hang up and list calls, and download their recordings. It cannot send or read SMS, read or manage webhook endpoints, nor create ephemeral keys (`403`). Restricted to a line, it sees that line only: other lines, their calls and sessions answer `404`, and placing a call on another line `403`. A call or session already open keeps working after the key expires.

POST
/v1/ephemeral-keys

Creates a short-lived key (15 minutes) that a browser uses instead of your API key, with the ICE servers it needs for WebRTC. Call it from your server, then hand the response to the browser.

An ephemeral key can list lines, open and close WebRTC sessions, place, answer, hang up and list calls, and download their recordings. It cannot send or read SMS, read or manage webhook endpoints, nor create ephemeral keys (403). Restricted to a line, it sees that line only: other lines, their calls and sessions answer 404, and placing a call on another line 403. A call or session already open keeps working after the key expires.

Authorization

apiKey
headerAuthorizationBearer <token>

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

Request Body

application/json
  1. body
line_id?LineId

Restrict the key to one line. Without it, the key reaches every line of the company.

Match^line_[0-9a-z]{26}$

Response Body

Created.

application/json
  1. response
ephemeral_key*string

Send it as Authorization: Bearer ek_….

Match^ek_[A-Za-z0-9]{43}$
expires_at*Timestamp

RFC 3339, UTC.

Formatdate-time
company_id*CompanyId
Match^cmp_[0-9a-z]{26}$
line_id?LineId
Match^line_[0-9a-z]{26}$
ice_servers*array<>

Ready for new RTCPeerConnection({ iceServers }): the STUN and TURN servers of 06 Line. When the deployment has a TURN server, its credentials are made for this key and stop working when it expires.

Example Request
curl -X POST 'https://api.06line.com/v1/ephemeral-keys' \  -H 'Content-Type: application/json' \  -d '{  "line_id": "line_01jbq5a3x9e2k7m4t6v8r0c1yb"}'
Example Response
{  "ephemeral_key": "ek_Jx8vQ2mL5nR9tW3yB6cF1hK4pS7zD0gA2eU5iO8rT1u",  "expires_at": "2026-10-21T14:18:11Z",  "company_id": "cmp_01jbq4f8k2e5t3m9x7v0a6h1zd",  "line_id": "line_01jbq5a3x9e2k7m4t6v8r0c1yb",  "ice_servers": [    {      "urls": [        "stun:turn.06line.com:3478"      ]    },    {      "urls": [        "turn:turn.06line.com:3478?transport=udp",        "turns:turn.06line.com:443?transport=tcp"      ],      "username": "1792640291:cmp_01jbq4f8k2e5t3m9x7v0a6h1zd",      "credential": "q9Xh2v..."    }  ]}