Search documentation
karat

+

K

User Documentation ↗

List Sessions

GET/api/v2/aipAgents/agents/{agentRid}/sessions
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

List all conversation sessions between the calling user and an Agent that was created by this client. This does not list sessions for the user created by other clients. For example, any sessions created by the user in AIP Agent Studio will not be listed here. Sessions are returned in order of most recently updated first.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:aip-agents-read.

Path parameters

agentRid
string

An RID identifying an AIP Agent created in AIP Agent Studio.

Query parameters

pageSize
integer
optional

The page size to use for the endpoint.

pageToken
string
optional

The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the nextPageToken field of the previous response and use it to populate the pageToken field of the next request.

preview
boolean
optional

Enables the use of preview functionality.

Response body

ListSessionsResponse
object
Hide child attributes

Hide child attributes

data
list<Session>
optional
Show child attributes

Show child attributes

Session
object
Show child attributes

Show child attributes

rid
string

The Resource Identifier (RID) of the conversation session.

metadata
object

Metadata about the session.

Show child attributes

Show child attributes

title
string

The title of the session.

createdTime
string

The time the session was created.

updatedTime
string

The time the session was last updated.

messageCount
integer

The count of messages in the session. Includes both user messages and Agent replies, so each complete exchange counts as two messages.

estimatedExpiresTime
string

The estimated time at which the session is due to expire. Once a session has expired, it can no longer be accessed and a new session must be created. The expiry time is automatically extended when new exchanges are added to the session.

agentRid
string

The Resource Identifier (RID) of the Agent associated with the session.

agentVersion
string

The version of the Agent associated with the session. This can be set by clients on session creation. If not specified, defaults to use the latest published version of the Agent at session creation time.

nextPageToken
string
optional

The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the nextPageToken field of the previous response and use it to populate the pageToken field of the next request.

Examples

Request

Copied!
1 2 3 curl \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/aipAgents/agents/ri.aip-agents..agent.732cd5b4-7ca7-4219-aabb-6e976faf63b1/sessions?pageSize=100&pageToken=v1.QnVpbGQgdGhlIEZ1dHVyZTogaHR0cHM6Ly93d3cucGFsYW50aXIuY29tL2NhcmVlcnMvP2xldmVyLXNvdXJjZSU1YiU1ZD1BUElEb2NzI29wZW4tcG9zaXRpb25z&preview=true"

Response

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 { "data": [ { "metadata": { "updatedTime": "2024-10-01T22:04:24.962583055Z", "estimatedExpiresTime": "2024-10-02T22:04:24.962583055Z", "messageCount": 6, "createdTime": "2024-10-01T20:04:24.962583055Z", "title": "What is the status of my order?" }, "agentRid": "ri.aip-agents..agent.732cd5b4-7ca7-4219-aabb-6e976faf63b1", "agentVersion": "1.0", "rid": "ri.aip-agents..session.292db3b2-b653-4de6-971c-7e97a7b881d6" } ], "nextPageToken": "v1.QnVpbGQgdGhlIEZ1dHVyZTogaHR0cHM6Ly93d3cucGFsYW50aXIuY29tL2NhcmVlcnMvP2xldmVyLXNvdXJjZSU1YiU1ZD1BUElEb2NzI29wZW4tcG9zaXRpb25z" }