Get Chat Session
curl --request GET \
--url https://api.eigi.ai/v1/public/chat/sessions/{session_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.eigi.ai/v1/public/chat/sessions/{session_id}"
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.eigi.ai/v1/public/chat/sessions/{session_id}', 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.eigi.ai/v1/public/chat/sessions/{session_id}",
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.eigi.ai/v1/public/chat/sessions/{session_id}"
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.eigi.ai/v1/public/chat/sessions/{session_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eigi.ai/v1/public/chat/sessions/{session_id}")
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{
"session_id": "<string>",
"agent_id": "<string>",
"status": "IN_PROGRESS",
"messages": [
{
"role": "user",
"content": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"message_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"metadata": {}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Chat
Get Chat Session
Retrieve complete details and messages for a specific chat session
GET
/
v1
/
public
/
chat
/
sessions
/
{session_id}
Get Chat Session
curl --request GET \
--url https://api.eigi.ai/v1/public/chat/sessions/{session_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.eigi.ai/v1/public/chat/sessions/{session_id}"
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.eigi.ai/v1/public/chat/sessions/{session_id}', 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.eigi.ai/v1/public/chat/sessions/{session_id}",
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.eigi.ai/v1/public/chat/sessions/{session_id}"
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.eigi.ai/v1/public/chat/sessions/{session_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eigi.ai/v1/public/chat/sessions/{session_id}")
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{
"session_id": "<string>",
"agent_id": "<string>",
"status": "IN_PROGRESS",
"messages": [
{
"role": "user",
"content": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"message_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"metadata": {}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Overview
This endpoint retrieves the complete chat session including all messages, status, and metadata. Use it to review conversation history, display chat transcripts, or sync session data with external systems.Authentication
string
required
Your eigi.ai API key. Must be prefixed with
vk_.Path Parameters
string
required
The unique identifier of the chat session to retrieve. Example:
58a6b549-ef07-4a31-86bc-0eb0e026840aResponse
string
Unique identifier for the chat session.
string
ID of the agent handling this session.
string
Current session status. One of:
IN_PROGRESS, COMPLETED, DISCONNECTED,
FAILED.array
Array of all messages in the session.
integer
Total number of messages in the session.
string
ISO 8601 timestamp when the session was created.
string
ISO 8601 timestamp when the session was last updated.
object
Custom metadata attached to the session.
Message Object
Each message in themessages array contains:
string
Who sent the message:
user or assistant.string
The text content of the message.
string
ISO 8601 timestamp when the message was sent.
Examples
Get Session Details
curl -X GET "https://api.eigi.ai/v1/public/chat/sessions/58a6b549-ef07-4a31-86bc-0eb0e026840a" \
-H "X-API-Key: vk_your_api_key_here"
import requests
session_id = "58a6b549-ef07-4a31-86bc-0eb0e026840a"
response = requests.get(
f"https://api.eigi.ai/v1/public/chat/sessions/{session_id}",
headers={"X-API-Key": "vk_your_api_key_here"}
)
session = response.json()
print(f"Session Status: {session['status']}")
print(f"Total Messages: {session['message_count']}")
for msg in session["messages"]:
print(f"{msg['role'].title()}: {msg['content']}")
const sessionId = "58a6b549-ef07-4a31-86bc-0eb0e026840a";
const response = await fetch(
`https://api.eigi.ai/v1/public/chat/sessions/${sessionId}`,
{
headers: {
"X-API-Key": "vk_your_api_key_here",
},
}
);
const session = await response.json();
console.log(`Session Status: ${session.status}`);
console.log(`Total Messages: ${session.message_count}`);
session.messages.forEach((msg) => {
console.log(`${msg.role}: ${msg.content}`);
});
Response Example
{
"session_id": "58a6b549-ef07-4a31-86bc-0eb0e026840a",
"agent_id": "68ea2517dbb84c09bae1ba0a",
"status": "IN_PROGRESS",
"messages": [
{
"role": "assistant",
"content": "Hello! Welcome to our support. How can I help you today?",
"timestamp": "2025-12-05T10:00:00.000Z"
},
{
"role": "user",
"content": "I need help resetting my password",
"timestamp": "2025-12-05T10:00:15.000Z"
},
{
"role": "assistant",
"content": "I'd be happy to help you reset your password. Could you please provide the email address associated with your account?",
"timestamp": "2025-12-05T10:00:17.000Z"
},
{
"role": "user",
"content": "It's john@example.com",
"timestamp": "2025-12-05T10:00:30.000Z"
},
{
"role": "assistant",
"content": "Thank you! I've sent a password reset link to john@example.com. Please check your inbox and follow the instructions. The link will expire in 24 hours. Is there anything else I can help you with?",
"timestamp": "2025-12-05T10:00:33.000Z"
}
],
"message_count": 5,
"created_at": "2025-12-05T10:00:00.000Z",
"updated_at": "2025-12-05T10:00:33.000Z",
"metadata": {
"user_id": "user_123",
"source": "website"
}
}
Error Responses
| Status Code | Description |
|---|---|
| 400 Bad Request | The specified session is not a chat session (e.g., it’s a voice call) |
| 401 Unauthorized | Missing, invalid, inactive, or expired API key |
| 403 Forbidden | API key owner doesn’t have access to this session |
| 404 Not Found | Session not found with the given ID |
Example Error Response
{
"detail": "Session not found"
}
Use Cases
Chat History
Display full conversation history to users
Export Transcripts
Export chat transcripts for records or analysis
Resume Conversations
Continue conversations from where they left off
Support Handoff
Review context before human agent takeover
Authorizations
API key for authentication. Get your API key from the eigi.ai Dashboard under Settings → API Keys.
Path Parameters
The unique session ID
Response
Successfully retrieved chat session

