{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-communication-services/json-schema/microsoft-azure-communication-services-delivery-report-schema.json",
  "title": "DeliveryReport",
  "description": "Delivery report for an outgoing SMS message.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-azure-communication-services-sms-api-openapi.yml#/components/schemas/DeliveryReport",
  "required": [
    "deliveryStatus",
    "messageId",
    "from",
    "to"
  ],
  "type": "object",
  "properties": {
    "deliveryStatus": {
      "description": "The delivery status of the message.",
      "type": "string",
      "enum": [
        "Delivered",
        "Failed"
      ]
    },
    "deliveryStatusDetails": {
      "description": "Detailed information about the delivery status.",
      "type": "string"
    },
    "deliveryAttempts": {
      "description": "Array of delivery attempts made for this message.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/DeliveryAttempt"
      }
    },
    "receivedTimestamp": {
      "description": "The timestamp when the delivery report was received.",
      "type": "string",
      "format": "date-time"
    },
    "tag": {
      "description": "Custom tag provided when sending the message.",
      "type": "string"
    },
    "messagingConnectPartnerMessageId": {
      "description": "Message ID generated by Messaging Connect Partner. Only present for delivery reports created during Messaging Connect flow.",
      "type": "string"
    },
    "messageId": {
      "description": "The identifier of the outgoing message.",
      "type": "string"
    },
    "from": {
      "description": "The sender's phone number in E.164 format.",
      "type": "string"
    },
    "to": {
      "description": "The recipient's phone number in E.164 format.",
      "type": "string"
    }
  },
  "$defs": {
    "DeliveryAttempt": {
      "description": "Details of a delivery attempt.",
      "required": [
        "timestamp",
        "segmentsSucceeded",
        "segmentsFailed"
      ],
      "type": "object",
      "properties": {
        "timestamp": {
          "description": "The timestamp of the delivery attempt.",
          "type": "string",
          "format": "date-time"
        },
        "segmentsSucceeded": {
          "description": "Number of message segments that were successfully delivered.",
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "segmentsFailed": {
          "description": "Number of message segments that failed to be delivered.",
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    }
  }
}