{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bamf-ai/json-schema/bamf-ai-exact-thread-reply-prepare-request-schema.json",
  "title": "ExactThreadReplyPrepareRequest",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bamf-ai-openapi.json#/components/schemas/ExactThreadReplyPrepareRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "workspace_id",
    "intent"
  ],
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid"
    },
    "intent": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "version",
        "account_ref",
        "channel",
        "action",
        "draft_id",
        "draft_revision",
        "draft_sha256",
        "approval_id",
        "thread",
        "identity"
      ],
      "properties": {
        "version": {
          "const": "exact-thread-reply/v1"
        },
        "account_ref": {
          "type": "string"
        },
        "channel": {
          "type": "string",
          "enum": [
            "linkedin",
            "gmail",
            "x",
            "instagram"
          ]
        },
        "action": {
          "type": "string",
          "enum": [
            "reply",
            "follow_up"
          ]
        },
        "draft_id": {
          "type": "string"
        },
        "draft_revision": {
          "type": "integer",
          "minimum": 1
        },
        "draft_sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "approval_id": {
          "type": "string"
        },
        "thread": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "provider_thread_id",
            "source_message_id",
            "provider_receipt_id",
            "observed_at"
          ],
          "properties": {
            "provider_thread_id": {
              "type": "string"
            },
            "source_message_id": {
              "type": "string"
            },
            "provider_receipt_id": {
              "type": "string"
            },
            "observed_at": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        "identity": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "evidence_id",
            "subject_id",
            "linkedin_profile_url",
            "gmail_address",
            "observed_at",
            "expires_at"
          ],
          "properties": {
            "evidence_id": {
              "type": "string"
            },
            "subject_id": {
              "type": "string"
            },
            "linkedin_profile_url": {
              "type": [
                "string",
                "null"
              ]
            },
            "gmail_address": {
              "type": [
                "string",
                "null"
              ]
            },
            "observed_at": {
              "type": "string",
              "format": "date-time"
            },
            "expires_at": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      }
    }
  }
}