{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/communicate-so/json-schema/communicate-so-chat-response-schema.json",
  "title": "ChatResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/communicate-so-chat-api-openapi.yml#/components/schemas/ChatResponse",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "conversationId",
    "messageId",
    "userMessageId",
    "answer",
    "citations",
    "mode"
  ],
  "properties": {
    "conversationId": {
      "type": "string"
    },
    "ticketNumber": {
      "type": [
        "integer",
        "null"
      ]
    },
    "messageId": {
      "type": "string"
    },
    "userMessageId": {
      "type": "string"
    },
    "answer": {
      "type": "string"
    },
    "citations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Citation"
      }
    },
    "mode": {
      "type": "string",
      "enum": [
        "ai",
        "human"
      ]
    },
    "actionName": {
      "type": "string",
      "description": "Present when a workspace action produced the final answer."
    },
    "followUps": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 3,
      "description": "Optional suggested next questions returned with the answer."
    }
  },
  "$defs": {
    "Citation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "sourceId",
        "title",
        "snippet",
        "url"
      ],
      "properties": {
        "sourceId": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "snippet": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}