{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/callidus-legal-ai/json-schema/callidus-legal-ai-suggest-instruction-request-schema.json",
  "title": "SuggestInstructionRequest",
  "description": "The open thread, for writing a starting instruction from it.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/callidus-legal-ai-addin-outlook-api-openapi.yml#/components/schemas/SuggestInstructionRequest",
  "properties": {
    "conversation_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1024
        },
        {
          "type": "null"
        }
      ],
      "title": "Conversation Id",
      "description": "Graph conversation id. When present the thread is fetched from Graph; ``thread`` is the fallback, as on the draft endpoint."
    },
    "thread": {
      "$ref": "#/$defs/DraftThread",
      "default": {
        "subject": "",
        "messages": []
      }
    }
  },
  "type": "object",
  "$defs": {
    "DraftThread": {
      "properties": {
        "subject": {
          "type": "string",
          "maxLength": 1000,
          "title": "Subject",
          "default": ""
        },
        "messages": {
          "items": {
            "$ref": "#/$defs/ThreadMessage"
          },
          "type": "array",
          "maxItems": 40,
          "title": "Messages"
        }
      },
      "type": "object",
      "title": "DraftThread",
      "description": "The email thread the reply belongs to. The first message is the one being replied to."
    },
    "ThreadMessage": {
      "properties": {
        "from": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "From",
          "description": "Sender, formatted as the pane displays it."
        },
        "to": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 50,
          "title": "To"
        },
        "sent_at": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ],
          "title": "Sent At"
        },
        "body_text": {
          "type": "string",
          "maxLength": 50000,
          "title": "Body Text",
          "default": ""
        }
      },
      "type": "object",
      "title": "ThreadMessage",
      "description": "One message of the open Outlook thread, as the pane read it."
    }
  }
}