{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tellers-ai/json-schema/tellers-ai-chat-history-response-schema.json",
  "title": "ChatHistoryResponse",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tellers-ai-openapi.json#/components/schemas/ChatHistoryResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "custom_agent_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Custom Agent Id"
    },
    "total_tokens": {
      "type": "number",
      "title": "Total Tokens"
    },
    "is_running": {
      "type": "boolean",
      "title": "Is Running"
    },
    "last_read_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Read At",
      "description": "The `created_at` of the newest message the caller has read in this chat. Null when the caller has never read it; such a chat counts as read."
    },
    "is_unread": {
      "type": "boolean",
      "title": "Is Unread",
      "description": "Whether the agent has written a message newer than `last_read_at`. The caller's own messages never make a chat unread. Reading the newest page of `GET /chat/{chat_id}/messages` or calling `POST /chat/{chat_id}/read` clears it.",
      "default": false
    },
    "can_write": {
      "type": "boolean",
      "title": "Can Write",
      "description": "Whether the caller may send messages in the chat, rename it or delete it. False when the chat was only shared with them to view.",
      "default": true
    },
    "parent_chat_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parent Chat Id",
      "description": "For a sub-chat, the main chat that started it; null for a main chat. Sub-chats are not in `GET /chats/list`: list them with `GET /chat/{chat_id}/sub_chats` on their main chat."
    },
    "sub_chat_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sub Chat Index",
      "description": "For a sub-chat started from a CSV, the row it works on (0 = first row under the header); null otherwise."
    },
    "sub_chat_count": {
      "type": "integer",
      "title": "Sub Chat Count",
      "description": "How many sub-chats this chat has started.",
      "default": 0
    },
    "running_sub_chat_count": {
      "type": "integer",
      "title": "Running Sub Chat Count",
      "description": "How many of this chat's sub-chats are running now.",
      "default": 0
    }
  },
  "type": "object",
  "required": [
    "id",
    "name",
    "created_at",
    "updated_at",
    "custom_agent_id",
    "total_tokens",
    "is_running"
  ]
}