---
title: "Retrieve a previous AI chat"
method: GET
path: "/v1/org/{orgId}/ai/chat/{chatId}"
tags: ["ai"]
---

# Retrieve a previous AI chat

`GET /v1/org/{orgId}/ai/chat/{chatId}`

## Path parameters

- `orgId` string, required
- `chatId` string, required

## Response `200`

successful operation

- AiChat
  - `id` string, required — globally unique id
  - `orgId` string, 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
  - `userId` string, required — user id who initiated the chat
  - `agentUserId` string, required — AI agent user id who is participating in the chat
  - `behalfUserId` string — user id this chat was created on behalf of, when an agent initiated it (userId is then the initiating agent)
  - `modelId` string — model that was used in the chat
  - `aiPromptId` string — prompt id that was used in the chat
  - `actionId` string — action that triggered the chat, if autonomous action
  - `actionStepId` string — action step id that triggered the chat, if autonomous action
  - `label` string — label for the chat (defaults to the first question asked)
  - `feedbackScore` integer — feedback score for the chat
  - `shareAccess` ShareAccess[], required — users who are specifically granted permission to view or edit this chat
    - `access` 'NONE' | 'LIMITED_READ' | 'LIMITED_WRITE' | 'STANDARD_READ' | 'STANDARD_WRITE' | 'COMPENSATION_READ' | 'FULL_READ' | 'COMP_PLANNING_PARTICIPANT' | 'COMPENSATION_WRITE' | 'WRITE' | 'COMPENSATION_OWNER' | 'OWNER', required — access permission level
    - `userId` string — user id
    - `groupId` string — group id
    - `everyone` boolean — grant this access level to everyone in the org (mutually exclusive with userId/groupId)
    - `fields` string — fields
  - `systemPrompts` string[] — system prompts used (stable prefix; eligible for prompt caching across turns)
  - `messages` AiChatMessage[] — transcript of the messages
    - `id` string, required
    - `userId` string
    - `userName` string
    - `externalUserId` string
    - `externalId` string
    - `blocks` AiChatMessageBlock[], required
      - `dataContextMessage` string
      - `contextMessage` string
      - `message` string
      - `toolUse` AiToolUse
        - `toolUseId` string, required
        - `name` string, required
        - `input` object, required
        - `entity` AiToolEntity
          - `id` string, required
          - `label` string, required
          - `imagePath` string
          - `entityType` string
        - `summary` string
        - `readOnly` boolean
      - `toolResult` AiToolResult
        - `toolUseId` string, required
        - `success` boolean, required
        - `outputText` string
        - `outputJson` object
        - `outputCsv` TabularData
          - `columnNames` string[], required
          - `rows` object[], required
          - `totalRow` object
          - `date` string, date
          - `next` string
        - `navigateUrl` string, uri
        - `actionButton` AiToolActionButton
          - `label` string, required
          - `url` string, uri, required
          - `iconUrl` string, uri
        - `userRejected` boolean
        - `userRejectedReason` string
        - `hintIds` string[]
    - `at` string, required
    - `latencyMs` integer
    - `inputTokenCount` integer
    - `outputTokenCount` integer
    - `cacheReadInputTokenCount` integer
    - `cacheWriteInputTokenCount` integer
    - `feedbackScore` integer
    - `feedbackText` string
    - `actionButtons` AiToolActionButton[]
      - `label` string, required
      - `url` string, uri, required
      - `iconUrl` string, uri
    - `fileIds` string[]
  - `messageCount` integer — number of messages in the chat
  - `totalMessageCount` integer — number of messages in the chat, including tool usage
  - `summary` AiChatSummary
    - `title` string, required
    - `summary` string, required
    - `keywords` string[], required
    - `usecase` string, required
    - `safetyScore` integer
    - `complexityScore` integer
    - `uniqueScore` integer
    - `successScore` integer
    - `improvements` string
    - `toolsNeeded` string
    - `safetyRisks` string
    - `at` string, required
  - `inputTokenCount` integer — number of input tokens used
  - `outputTokenCount` integer — number of output tokens used
  - `cacheReadInputTokenCount` integer — number of cached input tokens read from the prompt cache
  - `cacheWriteInputTokenCount` integer — number of input tokens written to the prompt cache
  - `creditCount` number — number of AI credits consumed by this chat
  - `dataContextType` 'ASSESSMENT' | 'ASSESSMENT_CALIBRATE' | 'COMP_REVIEW' | 'COMP_REVIEW_IMPACT_DASHBOARD' | 'PERSON_COMMON' | 'DASHBOARD' | 'FORM_COMPLETE' | 'GOAL' | 'SCENARIO' | 'SCENARIO_IMPACT' | 'TRANSCRIPT' | 'PROCESS_LOG' — data context used for this chat
  - `toolsAvailable` string[] — list of tools that were available in this chat
  - `readOnly` boolean — whether tool use in this chat is constrained to read-only tools
  - `toolsUsed` string[] — list of tools that were used in this chat
  - `providedHintIds` string[] — set of AI hint IDs that have been provided to this chat
  - `pendingToolUseIds` string[] — tool use IDs currently pending approval, used for idempotent approval
  - `pendingToolUseAt` string — timestamp when the pending tool uses were proposed, used for expiration
  - `channel` AiChatChannel
    - `type` 'WEB' | 'MOBILE' | 'SLACK' | 'TEAMS' | 'MCP', required
    - `externalId` string
    - `threadId` string
    - `name` string
  - `createAt` string — created timestamp
  - `updateAt` string — last-updated timestamp
  - `deleteId` string — deleted by user id
  - `deleteAt` string — deleted timestamp

## Other responses

- `400` — invalid data
- `401` — not authorized
- `403` — permission denied
- `404` — not found

---

[API](https://skmtc.dev/charthop/apis/charthop-api.md) · [All operations](https://skmtc.dev/charthop/apis/charthop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/charthop/charthop-api/revisions/2d6f51bdc66b/schema)
