Sitzungen auflisten
curl --request GET \
--url https://api.truthlocks.com/v1/agent-sessions \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.truthlocks.com/v1/agent-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/agent-sessions"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/agent-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))
}{
"items": [
{
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token": "<string>",
"scopes": [
"<string>"
],
"status": "active",
"metadata": {},
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"terminated_at": "2023-11-07T05:31:56Z"
}
],
"total": 123
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Agentensitzungen & Tools
Sitzungen auflisten
Agentensitzungen mit Filterung nach Agent, Status und Paginierung auflisten
GET
/
v1
/
agent-sessions
Sitzungen auflisten
curl --request GET \
--url https://api.truthlocks.com/v1/agent-sessions \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.truthlocks.com/v1/agent-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/agent-sessions"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/agent-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))
}{
"items": [
{
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token": "<string>",
"scopes": [
"<string>"
],
"status": "active",
"metadata": {},
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"terminated_at": "2023-11-07T05:31:56Z"
}
],
"total": 123
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Sitzungen auflisten
GET /v1/agent-sessions
Gibt eine paginierte Liste von Agentensitzungen für den authentifizierten Mandanten zurück. Die Ergebnisse können nach Agenten-ID und Sitzungsstatus gefiltert werden. Sitzungen werden in umgekehrter chronologischer Reihenfolge (neueste zuerst) zurückgegeben.
Authentifizierung
ErfordertX-API-Key Header oder Bearer JWT Token. Der Arbeitsbereich wird aus den authentifizierten Anmeldeinformationen abgeleitet; senden Sie X-Tenant-ID nicht.
Antwort
Array von Session-Objekten. Jedes enthält
session_id, agent_id, status,
scopes, metadata, expires_at, parent_session_id, handed_off_to,
ip_address, user_agent, refreshed_at, terminated_at, created_at und
updated_at. Token-Hashes werden niemals in Listenantworten offengelegt.Beispiel
curl -G https://api.truthlocks.com/v1/agent-sessions \
-H "X-API-Key: tl_live_..." \
-d "agent_id=maip:t1234567:01HYX3KPZQ7RJGBN0WFMV8SDEH" \
-d "status=active" \
-d "limit=25" \
-d "offset=0"
Referenz zum Sitzungsstatus
| Status | Beschreibung |
|---|---|
active | Sitzung ist gültig und akzeptiert Anfragen |
expired | Sitzungs-TTL ist abgelaufen; nicht mehr gültig |
terminated | Sitzung wurde explizit über API beendet |
handed_off | Sitzung wurde per Übergabe an einen anderen Agenten übertragen |

