> ## Documentation Index
> Fetch the complete documentation index at: https://developer.kallglot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve Session

> Get session details and status

Retrieve the current state of a session including status, languages, and connection details.

## Path Parameters

<ParamField path="id" type="string" required>
  Session ID (e.g., `sess_01HXYZ123456789`).
</ParamField>

## Response

<ResponseField name="id" type="string">
  Session identifier.
</ResponseField>

<ResponseField name="object" type="string">
  Always `session`.
</ResponseField>

<ResponseField name="status" type="string">
  `created`, `active`, or `ended`.
</ResponseField>

<ResponseField name="mode" type="string">
  Session mode.
</ResponseField>

<ResponseField name="source_language" type="string">
  Source language code.
</ResponseField>

<ResponseField name="target_language" type="string">
  Target language code.
</ResponseField>

<ResponseField name="stream" type="object">
  WebSocket connection (only for active sessions).

  <Expandable title="properties">
    <ResponseField name="url" type="string">
      WebSocket URL.
    </ResponseField>

    <ResponseField name="token" type="string">
      Authentication token.
    </ResponseField>

    <ResponseField name="expires_at" type="string">
      Token expiration (ISO 8601).
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="provider" type="string">
  **Response only** — which carrier is attached (`twilio`, `telnyx`, or `sip`). Set telephony on create with **`routing`**, not this field.
</ResponseField>

<ResponseField name="phone_number" type="string">
  Phone number used (if applicable).
</ResponseField>

<ResponseField name="recording" type="object">
  <Expandable title="properties">
    <ResponseField name="enabled" type="boolean">
      Whether recording is enabled.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="metadata" type="object">
  Custom metadata.
</ResponseField>

<ResponseField name="created_at" type="string">
  Creation timestamp (ISO 8601).
</ResponseField>

<ResponseField name="started_at" type="string">
  When session became active. Null if not started.
</ResponseField>

<ResponseField name="ended_at" type="string">
  When session ended. Null if still active.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.kallglot.com/v1/sessions/sess_01HXYZ123456789 \
    -H "Authorization: Bearer sk_live_your_api_key"
  ```

  ```python Python theme={null}
  import os
  import requests

  API_KEY = os.environ.get('KALLGLOT_API_KEY')
  SESSION_ID = 'sess_01HXYZ123456789'

  response = requests.get(
      f'https://api.kallglot.com/v1/sessions/{SESSION_ID}',
      headers={'Authorization': f'Bearer {API_KEY}'}
  )

  if response.status_code == 200:
      session = response.json()
      print(f"Status: {session['status']}")
      print(f"Mode: {session['mode']}")
      if session.get('stream'):
          print(f"WebSocket: {session['stream']['url']}")
  elif response.status_code == 404:
      print('Session not found')
  else:
      error = response.json()
      print(f"Error: {error['error']['message']}")
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = process.env.KALLGLOT_API_KEY;
  const SESSION_ID = 'sess_01HXYZ123456789';

  const response = await fetch(`https://api.kallglot.com/v1/sessions/${SESSION_ID}`, {
    headers: { 'Authorization': `Bearer ${API_KEY}` }
  });

  const data = await response.json();

  if (response.ok) {
    console.log('Status:', data.status);
    console.log('Mode:', data.mode);
    if (data.stream) {
      console.log('WebSocket:', data.stream.url);
    }
  } else {
    console.error('Error:', data.error.message);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Active theme={null}
  {
    "id": "sess_01HXYZ123456789",
    "object": "session",
    "status": "active",
    "mode": "bidirectional_translation",
    "provider": "twilio",
    "phone_number": "+14155551234",
    "source_language": "de",
    "target_language": "en",
    "stream": {
      "url": "wss://api.kallglot.com/v1/sessions/sess_01HXYZ123456789/connect",
      "token": "kst_live_xxxxxxxx",
      "expires_at": "2026-03-26T12:00:00Z"
    },
    "recording": { "enabled": true },
    "metadata": { "customer_id": "123" },
    "created_at": "2026-03-26T11:00:00Z",
    "started_at": "2026-03-26T11:00:15Z",
    "ended_at": null
  }
  ```

  ```json 200 Ended theme={null}
  {
    "id": "sess_01HXYZ123456789",
    "object": "session",
    "status": "ended",
    "mode": "bidirectional_translation",
    "provider": "twilio",
    "source_language": "de",
    "target_language": "en",
    "recording": { "enabled": true },
    "metadata": { "customer_id": "123" },
    "created_at": "2026-03-26T11:00:00Z",
    "started_at": "2026-03-26T11:00:15Z",
    "ended_at": "2026-03-26T11:04:20Z"
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "session_not_found",
      "message": "Session not found",
      "type": "not_found_error"
    }
  }
  ```
</ResponseExample>
