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.
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.
apiKeyAuthorizationBearer <token>Your API key, 06l_…. For servers only.
application/json- body
line_id?LineIdRestrict the key to one line. Without it, the key reaches every line of the company.
^line_[0-9a-z]{26}$Created.
application/json- response
ephemeral_key*stringSend it as Authorization: Bearer ek_….
^ek_[A-Za-z0-9]{43}$expires_at*TimestampRFC 3339, UTC.
date-timecompany_id*CompanyId^cmp_[0-9a-z]{26}$line_id?LineId^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.
curl -X POST 'https://api.06line.com/v1/ephemeral-keys' \ -H 'Content-Type: application/json' \ -d '{ "line_id": "line_01jbq5a3x9e2k7m4t6v8r0c1yb"}'{ "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..." } ]}