{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mammoth-io/json-schema/mammoth-io-connector-chat-request-schema.json",
  "title": "ConnectorChatRequest",
  "description": "Full conversation history for the AI connector chat",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mammoth-io-connector-chat-api-openapi.yml#/components/schemas/ConnectorChatRequest",
  "properties": {
    "session_id": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "maxLength": 128,
      "description": "Existing session ID to continue. None starts a new session."
    },
    "messages": {
      "items": {
        "$ref": "#/$defs/ChatMessage"
      },
      "type": "array",
      "maxItems": 100,
      "minItems": 1,
      "description": "Full conversation history including the latest user message."
    },
    "folder_resource_id": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Label resource ID of the folder to save the dataset into."
    }
  },
  "type": "object",
  "required": [
    "messages"
  ],
  "$defs": {
    "ChatMessage": {
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "user",
            "assistant"
          ]
        },
        "content": {
          "type": "string",
          "maxLength": 20000
        }
      },
      "type": "object",
      "required": [
        "content",
        "role"
      ],
      "title": "ChatMessage"
    }
  }
}