{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bamf-ai/json-schema/bamf-ai-outreach-growth-delivery-prepare-request-schema.json",
  "title": "OutreachGrowthDeliveryPrepareRequest",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bamf-ai-openapi.json#/components/schemas/OutreachGrowthDeliveryPrepareRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "tenant_id",
    "workspace_id",
    "principal_context_ref_id",
    "recipient",
    "eligibility",
    "artifacts",
    "approval",
    "suppression",
    "delivery"
  ],
  "properties": {
    "schema_version": {
      "type": "integer",
      "const": 1
    },
    "tenant_id": {
      "type": "string",
      "format": "uuid"
    },
    "workspace_id": {
      "type": "string",
      "format": "uuid"
    },
    "principal_context_ref_id": {
      "type": "string",
      "format": "uuid"
    },
    "recipient": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "recipient_id",
        "account_id",
        "thread_id"
      ],
      "properties": {
        "recipient_id": {
          "type": "string",
          "minLength": 1
        },
        "account_id": {
          "type": "string",
          "minLength": 1
        },
        "thread_id": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "eligibility": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "evidence_id",
        "tenant_id",
        "workspace_id",
        "principal_context_ref_id",
        "account_id",
        "thread_id",
        "recipient_id",
        "source_receipt_id",
        "post_id",
        "comment_id",
        "comment_text",
        "keyword",
        "captured_at",
        "eligible_until"
      ],
      "properties": {
        "evidence_id": {
          "type": "string",
          "minLength": 1
        },
        "tenant_id": {
          "type": "string",
          "format": "uuid"
        },
        "workspace_id": {
          "type": "string",
          "format": "uuid"
        },
        "principal_context_ref_id": {
          "type": "string",
          "format": "uuid"
        },
        "account_id": {
          "type": "string",
          "minLength": 1
        },
        "thread_id": {
          "type": "string",
          "minLength": 1
        },
        "recipient_id": {
          "type": "string",
          "minLength": 1
        },
        "source_receipt_id": {
          "type": "string",
          "minLength": 1
        },
        "post_id": {
          "type": "string",
          "minLength": 1
        },
        "comment_id": {
          "type": "string",
          "minLength": 1
        },
        "comment_text": {
          "type": "string",
          "minLength": 1
        },
        "keyword": {
          "type": "string",
          "minLength": 1
        },
        "captured_at": {
          "type": "string",
          "format": "date-time"
        },
        "eligible_until": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "artifacts": {
      "type": "array",
      "minItems": 3,
      "maxItems": 3,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "artifact_id",
          "revision"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "resource",
              "newsletter",
              "booking"
            ]
          },
          "artifact_id": {
            "type": "string",
            "minLength": 1
          },
          "revision": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "approval": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "approval_id",
        "revision",
        "binding",
        "approved_at",
        "expires_at"
      ],
      "properties": {
        "approval_id": {
          "type": "string",
          "minLength": 1
        },
        "revision": {
          "type": "string",
          "minLength": 1
        },
        "binding": {
          "type": "string",
          "minLength": 1
        },
        "approved_at": {
          "type": "string",
          "format": "date-time"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "suppression": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "opted_out",
        "checked_at"
      ],
      "properties": {
        "opted_out": {
          "type": "boolean"
        },
        "checked_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "delivery": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "delivery_id",
        "state",
        "prior_delivery_ids"
      ],
      "properties": {
        "delivery_id": {
          "type": "string",
          "minLength": 1
        },
        "state": {
          "type": "string",
          "const": "pending"
        },
        "prior_delivery_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}