curl --request GET \
--url https://api-prod.voltai.ai/chat/sessions/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api-prod.voltai.ai/chat/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-prod.voltai.ai/chat/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-prod.voltai.ai/chat/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-prod.voltai.ai/chat/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-prod.voltai.ai/chat/sessions/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.voltai.ai/chat/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{
"total_sessions": 123,
"used_sessions": 123,
"available_sessions": 123,
"active_user_ids": [
"<string>"
],
"source": "all"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Chat Sessions
Check how many chat sessions your organization is using and which user IDs are active.
curl --request GET \
--url https://api-prod.voltai.ai/chat/sessions/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api-prod.voltai.ai/chat/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-prod.voltai.ai/chat/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-prod.voltai.ai/chat/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-prod.voltai.ai/chat/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-prod.voltai.ai/chat/sessions/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.voltai.ai/chat/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{
"total_sessions": 123,
"used_sessions": 123,
"available_sessions": 123,
"active_user_ids": [
"<string>"
],
"source": "all"
}{
"detail": "<string>"
}{
"detail": "<string>"
}GET /chat/sessions/ to see how many sessions your organization is using. A user counts as one active session from their first question until five minutes pass with no new messages. Send X-API-KEY in the header.
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
source | "all" | "api" | "web" | "all" | Restrict the count to a traffic origin: api (API-key calls), web (in-app chats), or all. Any other value returns 400. |
Response
total_sessions— session limit for the organization;nullif unlimited.used_sessions— active sessions in the last five minutes, filtered bysource.available_sessions— remaining capacity;nullif unlimited.active_user_ids— theuser_idstrings currently active.source— echoes the query parameter.
Example Request
curl -s "https://api-prod.voltai.ai/chat/sessions/?source=api" \
-H "X-API-KEY: $API_KEY"
Example Response
{
"total_sessions": 10,
"used_sessions": 3,
"available_sessions": 7,
"active_user_ids": ["usr_82af91", "usr_d4f012", "usr_7ba3ee"],
"source": "all"
}
Authorizations
Query Parameters
Restrict the active-session count to a specific traffic origin. api counts only POST /chat/query/ calls authenticated with an API key, web counts only in-app chats from the web UI, and all (the default) combines both.
all, api, web Response
Session status
Floating-session usage for the organization. A session is active for five minutes after a user's first qualifying message; further messages in that window still count as one session per user identity.
Maximum floating sessions allowed for this organization. null if unlimited.
Number of distinct user identities with qualifying chat activity in the last five minutes.
Remaining floating sessions (total_sessions - used_sessions). null if unlimited.
Sorted list of user_id values that have an active floating session (recent activity in the five-minute window).
Traffic origin the counts were computed over. Echoes the source query parameter.
all, api, web