Skip to main content
GET
/
v1
/
sessions
List Sessions
curl --request GET \
  --url https://api.truthlocks.com/v1/sessions \
  --header 'X-API-Key: <api-key>'
{
  "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
}

List Sessions

GET /v1/agent-sessions Returns a paginated list of agent sessions for the authenticated tenant. Results can be filtered by agent ID and session status. Sessions are returned in reverse chronological order (newest first).

Authentication

Requires X-API-Key header or Bearer JWT token. Tenant-scoped via X-Tenant-ID.

Query Parameters

agent_id
string
Filter sessions by the owning agent’s MAIP identifier (e.g., maip:t1234567:01HYX3KPZQ7RJGBN0WFMV8SDEH).
status
string
Filter by session status. One of: "active", "expired", "terminated", "handed_off".
limit
integer
Maximum number of sessions to return per page. Range: 1-200. Default: 50.
offset
integer
Number of records to skip for pagination. Default: 0.

Response

sessions
object[]
Array of session objects. Each contains 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, and updated_at. Token hashes are never exposed in list responses.
total
integer
Total count of sessions matching the filter criteria, across all pages.

Example

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"

Session Status Reference

StatusDescription
activeSession is valid and accepting requests
expiredSession TTL has elapsed; no longer valid
terminatedSession was explicitly terminated via API
handed_offSession was transferred to another agent via handoff

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Query Parameters

agent_id
string<uuid>

Filter sessions by agent

status
enum<string>

Filter by session status

Available options:
active,
terminated,
expired
limit
integer
default:25
Required range: 1 <= x <= 100
offset
integer
default:0
Required range: x >= 0

Response

Paginated list of sessions

items
object[]
total
integer