{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cherami-to/json-schema/cherami-to-sent-summary-schema.json",
  "title": "SentSummary",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cherami-to-sending-api-openapi.yml#/components/schemas/SentSummary",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Cherami resource ID."
    },
    "inbox_id": {
      "type": "string",
      "description": "Cherami resource ID."
    },
    "created_at": {
      "type": "string",
      "description": "UTC timestamp with milliseconds.",
      "format": "date-time",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
    },
    "recipient_count": {
      "type": "integer",
      "minimum": 0
    },
    "status": {
      "type": "string",
      "enum": [
        "accepted",
        "rejected",
        "unknown"
      ]
    },
    "provider_message_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Message-ID the provider assigned when it accepted the message."
    },
    "error_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Reason code for a rejected or unknown outcome, such as E_RECIPIENT_SUPPRESSED or acceptance_unknown."
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Cherami resource ID."
        },
        {
          "type": "null"
        }
      ]
    },
    "in_reply_to": {
      "anyOf": [
        {
          "type": "string",
          "description": "Cherami resource ID."
        },
        {
          "type": "null"
        }
      ]
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "preview": {
      "anyOf": [
        {
          "$ref": "#/$defs/Preview"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "inbox_id",
    "created_at",
    "recipient_count",
    "status",
    "provider_message_id",
    "error_code",
    "thread_id",
    "in_reply_to",
    "labels",
    "preview"
  ],
  "$defs": {
    "Preview": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "description": "Start of the chosen text, whitespace collapsed; empty when the message added no new text.",
          "maxLength": 300
        },
        "truncated": {
          "type": "boolean",
          "description": "true when the chosen text was longer than the excerpt."
        },
        "source": {
          "type": "string",
          "enum": [
            "reply_text",
            "text",
            "html"
          ],
          "description": "Which text the excerpt comes from."
        }
      },
      "required": [
        "text",
        "truncated",
        "source"
      ]
    }
  }
}