Create an ephemeral key
Creates a short-lived key (15 minutes) that a browser uses instead of your API key, with the STUN and TURN servers it needs for WebRTC. Call it from your server, then hand the response to the browser. An ephemeral key can list lines, open WebRTC sessions and place, answer or hang up calls. It cannot send SMS or manage webhooks. 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 STUN and TURN servers it needs for WebRTC. Call it from your server, then hand the response to the browser.
An ephemeral key can list lines, open WebRTC sessions and place, answer or hang up calls. It cannot send SMS or manage webhooks. 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 }). TURN credentials last as long as the key.
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:ek_Jx8v", "credential": "q9Xh2v..." } ]}