List sessions
curl --request GET \
--url https://api.lehar.ai/ca/api/v0/sessions \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.lehar.ai/ca/api/v0/sessions"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.lehar.ai/ca/api/v0/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lehar.ai/ca/api/v0/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lehar.ai/ca/api/v0/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lehar.ai/ca/api/v0/sessions")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lehar.ai/ca/api/v0/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "01k4qx7m8p2rs5t7v9w1x3y5z7",
"session_id": "session_01k4qx7m8p2rs5t7v9w1x3y5z7",
"customer_id": "customer_01k3ab2c4d6e8f0g2h4j6k8m0n",
"user_id": "user_01k2zzs7q9r1s3t5v7w9x1y3z5",
"user_name": "Priya Sharma",
"agent_id": "agent_01k1mn3p5q7r9s1t3v5w7x9y1z",
"room_name": "session_01k4qx7m8p2rs5t7v9w1x3y5z7",
"participant_identity": "user_01k2zzs7q9r1s3t5v7w9x1y3z5",
"participant_name": "Priya Sharma",
"dispatch_id": "AD_9f2c1a7b",
"livekit_url": "wss://lehar-staging.livekit.cloud",
"status": "active",
"qualification_status": null,
"sentiment": null,
"metadata": {
"agent_id": "agent_01k1mn3p5q7r9s1t3v5w7x9y1z",
"user_name": "Priya Sharma",
"call_type": "web"
},
"call_type": "web",
"origin": "dashboard",
"call_id": null,
"started_at": "2026-09-02T10:15:30.482119+00:00",
"ended_at": null,
"created_at": "2026-09-02T10:15:30.482119+00:00",
"updated_at": "2026-09-02T10:15:30.482119+00:00"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"total": 1
}
}{
"error": {
"code": "invalid_request",
"message": "limit and offset must be non-negative integers"
}
}{
"error": {
"code": "unauthorized",
"message": "Authentication required"
}
}{
"error": {
"code": "forbidden",
"message": "Customer users can only list their own sessions"
}
}{
"error": {
"code": "not_found",
"message": "Customer not found"
}
}{
"error": {
"code": "internal_error",
"message": "An unexpected error occurred"
}
}Sessions
List sessions
Lists agent sessions for the workspace, newest first, with pagination. Normal-user bearer tokens are owner-scoped: they see only their own sessions and cannot filter by another user_id, while API-key and admin callers see every session in the workspace. Scope sessions:read.
GET
/
sessions
List sessions
curl --request GET \
--url https://api.lehar.ai/ca/api/v0/sessions \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.lehar.ai/ca/api/v0/sessions"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.lehar.ai/ca/api/v0/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lehar.ai/ca/api/v0/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lehar.ai/ca/api/v0/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lehar.ai/ca/api/v0/sessions")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lehar.ai/ca/api/v0/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "01k4qx7m8p2rs5t7v9w1x3y5z7",
"session_id": "session_01k4qx7m8p2rs5t7v9w1x3y5z7",
"customer_id": "customer_01k3ab2c4d6e8f0g2h4j6k8m0n",
"user_id": "user_01k2zzs7q9r1s3t5v7w9x1y3z5",
"user_name": "Priya Sharma",
"agent_id": "agent_01k1mn3p5q7r9s1t3v5w7x9y1z",
"room_name": "session_01k4qx7m8p2rs5t7v9w1x3y5z7",
"participant_identity": "user_01k2zzs7q9r1s3t5v7w9x1y3z5",
"participant_name": "Priya Sharma",
"dispatch_id": "AD_9f2c1a7b",
"livekit_url": "wss://lehar-staging.livekit.cloud",
"status": "active",
"qualification_status": null,
"sentiment": null,
"metadata": {
"agent_id": "agent_01k1mn3p5q7r9s1t3v5w7x9y1z",
"user_name": "Priya Sharma",
"call_type": "web"
},
"call_type": "web",
"origin": "dashboard",
"call_id": null,
"started_at": "2026-09-02T10:15:30.482119+00:00",
"ended_at": null,
"created_at": "2026-09-02T10:15:30.482119+00:00",
"updated_at": "2026-09-02T10:15:30.482119+00:00"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"total": 1
}
}{
"error": {
"code": "invalid_request",
"message": "limit and offset must be non-negative integers"
}
}{
"error": {
"code": "unauthorized",
"message": "Authentication required"
}
}{
"error": {
"code": "forbidden",
"message": "Customer users can only list their own sessions"
}
}{
"error": {
"code": "not_found",
"message": "Customer not found"
}
}{
"error": {
"code": "internal_error",
"message": "An unexpected error occurred"
}
}Authorizations
ApiKeyAuthBearerAuth
Query Parameters
Maximum number of sessions to return. Values above 100 are capped at 100.
Required range:
0 <= x <= 100Number of sessions to skip for pagination.
Required range:
x >= 0Filter to sessions owned by this user. Normal-user bearer callers are forced to their own user_id; passing a different value returns 403.
Filter to sessions created with this agent.

