{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendraven-ai/json-schema/sendraven-ai-approval-schema.json",
  "title": "Approval",
  "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/Approval",
  "type": "object",
  "required": [
    "id",
    "message_id",
    "api_key_id",
    "expires_at",
    "created_at",
    "message"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "The approval id, returned as approval_id by the held send."
    },
    "message_id": {
      "type": "string",
      "format": "uuid",
      "description": "The held message; queued in the email log until decided or expired. GET /v1/emails/{id} gives from and scheduled_at."
    },
    "api_key_id": {
      "type": "string",
      "description": "The key that made the send. That key cannot decide this approval."
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "After this it drops out of the list and cannot be decided."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "message": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "to",
        "subject",
        "text",
        "html"
      ],
      "description": "The content to review; null if the message no longer exists. No from, cc, bcc, reply_to, attachments or schedule.",
      "properties": {
        "to": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Bare recipient addresses."
        },
        "subject": {
          "type": "string"
        },
        "text": {
          "type": [
            "string",
            "null"
          ]
        },
        "html": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}