curl -X GET https://agent.api.lyzr.app/v1/users/{user_id}/sessions \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json"

[
  {
    "session_id": "hh@gmail.com",
    "created_at": "2024-08-21T12:38:10.504000"
  },
  {
    "session_id": "IITZ",
    "created_at": "2024-09-06T08:54:01.978000"
  }
]

Endpoint: GET /v1/users/{user_id}/sessions

This endpoint retrieves all sessions associated with a specific user identified by their user_id.

Parameters

user_id
string
required

The unique ID of the user.

Curl
curl -X GET https://agent.api.lyzr.app/v1/users/{user_id}/sessions \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json"

Python
import requests

user_id = "123"
url = "https://agent.api.lyzr.app/v1/users/{user_id}/sessions"
headers = {
    "x-api-key": "your_api_key_here",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
[
  {
    "session_id": "hh@gmail.com",
    "created_at": "2024-08-21T12:38:10.504000"
  },
  {
    "session_id": "IITZ",
    "created_at": "2024-09-06T08:54:01.978000"
  }
]

Response Parameters

session_id
string

The unique identifier for the session.

created_at
string

Timestamp of when the session was created.