v1

latestOpenAPI 3.1.0Elastic 2.02026-07-179371211.2 KB
Assistant

Get Assistant Session History

Retrieve a chat session's messages for a given user and session.

get/api/assistant/admin/{userId}/sessions/{sessionId}/history

Path parameters

userIdstring required

ID of the user to retrieve the session from

sessionIdstring required

ID of the session to retrieve, it must belong to the indicated user

Response

List of messages belonging to the session

createTimestring

The date and time that this object was created. This is a read-only field.

idstring

The ID assigned to this object by the server. This is a read-only field.

kindstring

The kind of object. This is a read-only field.

modelstring

The model used for this message.

operationstring

The operation that was applied to the object. This is a read-only field.

session_idstring

What session this message belongs to.

tagsstring[]

Metadata about the message.

updateTimestring

The date and time that this object was last modified. This is a read-only field.

userIdstring

The user ID (or API client ID) that initiated this event. This is a read-only field.

Example response

[
  {
    "createTime": "2024-11-14T15:03:22Z",
    "id": "PdFc-JIBLkNJ8-bDfz47",
    "kind": "case",
    "message": {
      "id": "c3d44fb8-3bc2-46e2-a7d2-8a8983556d1a",
      "role": "user",
      "stop_reason": "user_request",
      "stop_sequence": "end_turn",
      "usage": {
        "credits": 1,
        "input_tokens": 5,
        "output_tokens": 10
      }
    },
    "model": "sonnet-4.5@SOAI",
    "operation": "create",
    "session_id": "chat_1757086398900_ykhmndscn",
    "tags": [
      "investigation"
    ],
    "updateTime": "2024-11-14T15:33:02Z",
    "userId": "socl_my_new_client"
  }
]