{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendraven-ai/json-schema/sendraven-ai-approval-decision-schema.json",
  "title": "ApprovalDecision",
  "description": "The same keys for both decisions; a field with nothing to say is null or false.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendraven-ai-approvals-api-openapi.yml#/components/schemas/ApprovalDecision",
  "type": "object",
  "required": [
    "id",
    "status",
    "message_id",
    "scheduled_at",
    "skipped",
    "reason"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "approved",
        "rejected"
      ]
    },
    "message_id": {
      "type": "string",
      "format": "uuid"
    },
    "scheduled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Set when approved and the draft carried a scheduled_at still in the future: the message was put on the schedule (status scheduled), not sent now. null when it was sent now, and on a rejection."
    },
    "skipped": {
      "type": "boolean",
      "description": "True only when approved and no To address was left after re-checking suppressions and topic opt-outs: nothing was sent and the message is recorded as rejected. The approval still counts as approved. False otherwise, including on a rejection."
    },
    "reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "When skipped is true: suppressed:<suppression reason> (e.g. suppressed:hard_bounce) or unsubscribed_from_topic:<topic key>. null otherwise."
    }
  }
}