Get Web chat history

GET /v1/replicas/{replicaUUID}/chat/history/web

List web chat history items of a Replica belonging to the logged in user.

Path parameters

Responses

  • 200 application/json

    List the chat history of the replica by the currently logged in user

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • type string Required
    • items array[object]
      Hide items attributes Show items attributes object
      • content string Required

        The content of the message

      • created_at string(date-time) Required

        The date and time the message was created

      • id number Required

        The ID of the message

      • is_private boolean Required

        Whether the replica is private

      • role string Required

        The role of the message

        Values are user or assistant.

      • source string Required

        From which platform is message was sent from

        Values are discord, telegram, embed, web, or telegram_autopilot.

      • sources array[object] Required

        The sources of information used to create the response via RAG (Retrieval-Augmented Generation)

        Hide sources attributes Show sources attributes object
        • id number Required

          The ID of the source

        • score number Required

          Relevance score of the source

        • status string Required

          If the source has ever been scored or not

          Values are scored or unscored.

        • created_at string(date-time) Required

          When the source was created

        • name string Required

          The name of the source

        • content string Required

          The actual content retrieved from the source

      • user_uuid string Required

        The UUID of the user

      • original_message_id string | null Required Deprecated

        The ID of the message from the LLM. Present when role is assistant. Will be removed in the future.

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • The replica specified could not be found or you do not have access to it

  • 415 application/json

    Unsupported Media Type

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

    • The inner exception

      Hide inner_exception attributes Show inner_exception attributes object
GET /v1/replicas/{replicaUUID}/chat/history/web
curl \
 --request GET 'https://api.sensay.io/v1/replicas/03db5651-cb61-4bdf-9ef0-89561f7c9c53/chat/history/web' \
 --header "X-ORGANIZATION-SECRET: $API_KEY" \
 --header "X-USER-ID: $API_KEY"
Response examples (200)
{
  "success": true,
  "type": "string",
  "items": [
    {
      "content": "Hello",
      "created_at": "2024-09-24T09:09:55.66709+00:00",
      "id": 1,
      "is_private": false,
      "role": "user",
      "source": "web",
      "sources": [
        {
          "id": 123,
          "score": 0.9,
          "status": "scored",
          "created_at": "2024-03-15T14:30:00.000Z",
          "name": "Q: Next, what’s your nationality?",
          "content": "Next, what’s your nationality? Mars"
        }
      ],
      "user_uuid": "03db5651-cb61-4bdf-9ef0-89561f7c9c53",
      "original_message_id": "msg-GbsIAyNcNZCMAaDET3zXhInw"
    }
  ]
}
Response examples (400)
{
  "success": true,
  "error": "string",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab"
}
Response examples (401)
{
  "success": true,
  "error": "string",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab"
}
Response examples (415)
{
  "success": true,
  "error": "string",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab"
}
Response examples (500)
{
  "success": true,
  "error": "string",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
  "inner_exception": {
    "name": "Server overheated",
    "cause": "Request too complicated",
    "stack": "Error: Server overheated due to an unexpected situation\n    at Object.eval (eval at <anonymous>...",
    "message": "The server overheated due to an unexpected situation"
  }
}