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

POST
/v1/ephemeral-keys

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.

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 }). TURN credentials last as long as the key.

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:ek_Jx8v",      "credential": "q9Xh2v..."    }  ]}