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

# End Session

> End an active session

End a session to disconnect calls, stop recording, and finalize the transcript. Billing stops when the session ends.

## 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">
  Will be `ended`.
</ResponseField>

<ResponseField name="duration_seconds" type="number">
  Total session duration.
</ResponseField>

<ResponseField name="ended_at" type="string">
  End timestamp (ISO 8601).
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.kallglot.com/v1/sessions/sess_01HXYZ123456789/end \
    -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.post(
      f'https://api.kallglot.com/v1/sessions/{SESSION_ID}/end',
      headers={'Authorization': f'Bearer {API_KEY}'}
  )

  if response.status_code == 200:
      session = response.json()
      print(f"Session ended successfully")
      print(f"Duration: {session['duration_seconds']}s")
      print(f"Ended at: {session['ended_at']}")
  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}/end`, {
    method: 'POST',
    headers: { 'Authorization': `Bearer ${API_KEY}` }
  });

  const data = await response.json();

  if (response.ok) {
    console.log('Session ended successfully');
    console.log('Duration:', data.duration_seconds + 's');
    console.log('Ended at:', data.ended_at);
  } else {
    console.error('Error:', data.error.message);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "sess_01HXYZ123456789",
    "object": "session",
    "status": "ended",
    "duration_seconds": 245.3,
    "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>

<Note>
  Idempotent - calling on an already-ended session returns the existing summary.
</Note>

<Warning>
  Sessions inactive for 30+ minutes are automatically ended.
</Warning>
