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

# Fetch All Sessions

> Fetch the list of sessions for a chatbot specified by chatbot uuid

### Path

<ParamField path="uuid" type="string" required>
  Chatbot uuid
</ParamField>

### Query Parameters

<ParamField query="start_timestamp" type="string">
  Filter sessions created after this timestamp (inclusive).\
  Format: ISO 8601 — `YYYY-MM-DDTHH:mm:ss.sssZ`
</ParamField>

<ParamField query="end_timestamp" type="string">
  Filter sessions created before this timestamp (inclusive).\
  Format: ISO 8601 — `YYYY-MM-DDTHH:mm:ss.sssZ`
</ParamField>

#### Timestamp Format

The API uses [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format for timestamps:

* Format: `YYYY-MM-DDTHH:mm:ss.sssZ`
* Example:
  * `start_timestamp=2025-07-16T07:00:00.000Z` means July 16, 2025 at 7:00 AM UTC
  * `end_timestamp=2025-07-24T06:59:59.000Z` means July 24, 2025 at 6:59:59 AM UTC

#### Usage Tips

* Always use UTC timezone (`Z` at the end)
* Include milliseconds (`.000`) even if zero
* Use 24-hour time format
* Don’t forget the `T` separator between date and time
* URL-encode the entire value if passing in a URL manually

### Response

<ResponseField name type="object[]">
  Session list

  <Expandable title="Session properties">
    <ResponseField name="created_at" type="string" />

    <ResponseField name="modified_at" type="string" />

    <ResponseField name="uuid" type="string" />

    <ResponseField name="meta" type="meta Object">
      Session meta properties

      <Expandable title="properties">
        <ResponseField name="user" type="user Object">
          Exists when lead form was submitted by user
        </ResponseField>

        <ResponseField name="auth_data" type="auth_data Object">
          Exists when user completes "User Identity Verification" and "Save Data
          on Success" feature is enabled
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Curl theme={null}
  curl --location --request GET 'https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/sessions?start_timestamp={start_timestamp}&end_timestamp={end_timestamp}' \
  --header 'Authorization: Bearer <token>'
  ```

  ```py Python theme={null}
  import requests

  uuid = '<chatbot-uuid>'
  start_timestamp = '<timestamp>'
  end_timestamp = '<timestamp>'
  url = f'https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/sessions?start_timestamp={start_timestamp}&end_timestamp={end_timestamp}'
  headers = {
      'Authorization': 'Bearer <token>'
  }

  response = requests.get(url, headers=headers)

  if response.status_code == 200:
      print("Request successful!")
      print(response.json())
  else:
      print("Request failed with status code:", response.status_code)
      print(response.text)
  ```

  ```ts JavaScript theme={null}
  const axios = require("axios");

  const uuid = "<chatbot-uuid>";
  const start_timestamp = '<timestamp>'
  const end_timestamp = '<timestamp>'
  const url = `https://app.gpt-trainer.com/api/v1/chatbot/${uuid}/sessions?start_timestamp=${start_timestamp}&end_timestamp=${end_timestamp}`;
  const headers = {
    Authorization: "Bearer <token>",
  };

  axios
    .get(url, { headers })
    .then((response) => {
      console.log("Request successful!");
      console.log(response.data);
    })
    .catch((error) => {
      console.error("Request failed:", error);
    });
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  [
    {
      "created_at": "string",
      "modified_at": "string",
      "uuid": "string"
    }
  ]
  ```
</ResponseExample>
