v3

latestSwagger 2.02026-08-067506752.0 MB
ai

Retrieve a previous AI chat

get/v1/org/{orgId}/ai/chat/{chatId}

Path parameters

orgIdstring required

Org identifier (either id or slug)

chatIdstring required

Chat identifier

Response

successful operation

idstring required

globally unique id

orgIdstring required

parent organization id

type'OWNER' | 'INTERNAL' | 'STAFF' | 'CUSTOMER' | 'DEMO' | 'TEST' required

the type of the chat

mode'CHAT' | 'AUTO' required

the mode of the chat -- CHAT is an interactive chat, while AUTO is an autonomous action

userIdstring required

user id who initiated the chat

agentUserIdstring required

AI agent user id who is participating in the chat

behalfUserIdstring

user id this chat was created on behalf of, when an agent initiated it (userId is then the initiating agent)

modelIdstring

model that was used in the chat

aiPromptIdstring

prompt id that was used in the chat

actionIdstring

action that triggered the chat, if autonomous action

actionStepIdstring

action step id that triggered the chat, if autonomous action

labelstring

label for the chat (defaults to the first question asked)

feedbackScoreinteger

feedback score for the chat

systemPromptsstring[]

system prompts used (stable prefix; eligible for prompt caching across turns)

messageCountinteger

number of messages in the chat

totalMessageCountinteger

number of messages in the chat, including tool usage

inputTokenCountinteger

number of input tokens used

outputTokenCountinteger

number of output tokens used

cacheReadInputTokenCountinteger

number of cached input tokens read from the prompt cache

cacheWriteInputTokenCountinteger

number of input tokens written to the prompt cache

creditCountnumber

number of AI credits consumed by this chat

dataContextType'ASSESSMENT' | 'ASSESSMENT_CALIBRATE' | 'COMP_REVIEW' | 'PERSON_COMMON' | 'DASHBOARD' | 'FORM_COMPLETE' | 'GOAL' | 'SCENARIO' | 'SCENARIO_IMPACT' | 'TRANSCRIPT' | 'PROCESS_LOG'

data context used for this chat

toolsAvailablestring[]

list of tools that were available in this chat

readOnlyboolean

whether tool use in this chat is constrained to read-only tools

toolsUsedstring[]

list of tools that were used in this chat

providedHintIdsstring[]

set of AI hint IDs that have been provided to this chat

pendingToolUseIdsstring[]

tool use IDs currently pending approval, used for idempotent approval

pendingToolUseAtstring

timestamp when the pending tool uses were proposed, used for expiration

createAtstring

created timestamp

updateAtstring

last-updated timestamp

deleteIdstring

deleted by user id

deleteAtstring

deleted timestamp

Example response

{
  "id": "588f7ee98f138b19220041a7",
  "orgId": "588f7ee98f138b19220041a7",
  "userId": "588f7ee98f138b19220041a7",
  "agentUserId": "588f7ee98f138b19220041a7",
  "behalfUserId": "588f7ee98f138b19220041a7",
  "aiPromptId": "588f7ee98f138b19220041a7",
  "actionId": "588f7ee98f138b19220041a7",
  "actionStepId": "588f7ee98f138b19220041a7",
  "shareAccess": [
    {
      "userId": "5887a7718f138b6a2a0041a7",
      "groupId": "5887a7718f138b6a2a0041a7",
      "fields": "name,image,title"
    }
  ],
  "messages": [
    {
      "id": "588f7ee98f138b19220041a7",
      "userId": "588f7ee98f138b19220041a7",
      "blocks": [
        {
          "toolResult": {
            "outputCsv": {
              "next": "588f7ee98f138b19220041a7"
            },
            "hintIds": [
              "588f7ee98f138b19220041a7"
            ]
          }
        }
      ],
      "fileIds": [
        "588f7ee98f138b19220041a7"
      ]
    }
  ],
  "providedHintIds": [
    "588f7ee98f138b19220041a7"
  ],
  "createAt": "2017-01-24T13:57:52Z",
  "updateAt": "2017-01-24T13:57:52Z",
  "deleteId": "588f7ee98f138b19220041a7",
  "deleteAt": "2017-01-24T13:57:52Z"
}