{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coralogix/json-schema/coralogix-list-notification-deliveries-response-schema.json",
  "title": "List notification deliveries response",
  "description": "Response containing a list of notification delivery records for cases.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coralogix-cases-notification-service-api-openapi.yml#/components/schemas/ListNotificationDeliveriesResponse",
  "required": [
    "deliveriesByCase"
  ],
  "type": "object",
  "properties": {
    "deliveriesByCase": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/CaseNotificationDeliveries"
      },
      "description": "Notification deliveries keyed by case ID"
    }
  },
  "$defs": {
    "CaseNotificationDeliveries": {
      "title": "Case notification deliveries",
      "required": [
        "notificationDeliveries"
      ],
      "type": "object",
      "properties": {
        "notificationDeliveries": {
          "maxItems": 1000,
          "minItems": 0,
          "type": "array",
          "items": {
            "$ref": "#/$defs/NotificationDelivery"
          },
          "description": "Notification deliveries for the case"
        }
      },
      "description": "Notification deliveries for a single case."
    },
    "ConnectorDetails": {
      "title": "Connector details",
      "required": [
        "connectorId",
        "connectorType",
        "connectorName"
      ],
      "type": "object",
      "properties": {
        "connectorId": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$",
          "type": "string",
          "description": "Unique identifier of the connector"
        },
        "connectorName": {
          "maxLength": 256,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Display name of the connector"
        },
        "connectorType": {
          "allOf": [
            {
              "$ref": "#/$defs/v1.ConnectorType"
            }
          ],
          "description": "Type of the connector"
        }
      },
      "description": "Details of a notification connector."
    },
    "DeliveryAttempt": {
      "title": "Delivery attempt",
      "required": [
        "connector",
        "outcome"
      ],
      "type": "object",
      "properties": {
        "connector": {
          "allOf": [
            {
              "$ref": "#/$defs/ConnectorDetails"
            }
          ],
          "description": "The connector that the delivery was sent to"
        },
        "outcome": {
          "allOf": [
            {
              "$ref": "#/$defs/DeliveryOutcome"
            }
          ],
          "description": "Outcome of the delivery attempt"
        }
      },
      "description": "A single delivery attempt to a specific connector."
    },
    "DeliveryFailure": {
      "title": "Delivery failure",
      "required": [
        "errorMessage"
      ],
      "type": "object",
      "properties": {
        "errorMessage": {
          "maxLength": 4096,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Error message describing the failure"
        }
      },
      "description": "Failed delivery outcome with error details."
    },
    "DeliveryOutcome": {
      "title": "Delivery outcome",
      "type": "object",
      "oneOf": [
        {
          "required": [
            "success"
          ],
          "type": "object"
        },
        {
          "required": [
            "failure"
          ],
          "type": "object"
        },
        {
          "type": "object",
          "not": {
            "anyOf": [
              {
                "required": [
                  "success"
                ],
                "type": "object"
              },
              {
                "required": [
                  "failure"
                ],
                "type": "object"
              }
            ]
          }
        }
      ],
      "properties": {
        "failure": {
          "allOf": [
            {
              "$ref": "#/$defs/DeliveryFailure"
            }
          ],
          "description": "Delivery failed"
        },
        "success": {
          "allOf": [
            {
              "$ref": "#/$defs/DeliverySuccess"
            }
          ],
          "description": "Delivery succeeded"
        }
      },
      "description": "Outcome of a notification delivery attempt."
    },
    "DeliverySuccess": {
      "title": "Delivery success",
      "type": "object",
      "properties": {
        "evidenceUrl": {
          "description": "URL to the delivered notification, if available (e.g. Slack message, ServiceNow record)",
          "maxLength": 2048,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "x-coralogix-presence": true
        }
      },
      "description": "Successful delivery outcome with an optional evidence URL."
    },
    "NoNotificationCreatedResult": {
      "title": "No notification created result",
      "required": [
        "matchedRouters"
      ],
      "type": "object",
      "properties": {
        "matchedRouters": {
          "maxItems": 1000,
          "minItems": 0,
          "type": "array",
          "items": {
            "$ref": "#/$defs/RouterInfo"
          },
          "description": "Routers that matched the notification request"
        }
      },
      "description": "Indicates that routers matched but no notification was ultimately created."
    },
    "NoRouterMatchedResult": {
      "title": "No router matched result",
      "type": "object",
      "additionalProperties": false,
      "description": "Indicates that no router matched the notification request."
    },
    "NotificationDelivery": {
      "title": "Notification delivery",
      "required": [
        "timestamp"
      ],
      "type": "object",
      "oneOf": [
        {
          "required": [
            "noRouterMatched"
          ],
          "type": "object"
        },
        {
          "required": [
            "noNotificationCreated"
          ],
          "type": "object"
        },
        {
          "required": [
            "attempted"
          ],
          "type": "object"
        },
        {
          "type": "object",
          "not": {
            "anyOf": [
              {
                "required": [
                  "noRouterMatched"
                ],
                "type": "object"
              },
              {
                "required": [
                  "noNotificationCreated"
                ],
                "type": "object"
              },
              {
                "required": [
                  "attempted"
                ],
                "type": "object"
              }
            ]
          }
        }
      ],
      "properties": {
        "attempted": {
          "allOf": [
            {
              "$ref": "#/$defs/RoutedDelivery"
            }
          ],
          "description": "Delivery was attempted through a router to one or more connectors"
        },
        "noNotificationCreated": {
          "allOf": [
            {
              "$ref": "#/$defs/NoNotificationCreatedResult"
            }
          ],
          "description": "Routers matched but no notification was created"
        },
        "noRouterMatched": {
          "allOf": [
            {
              "$ref": "#/$defs/NoRouterMatchedResult"
            }
          ],
          "description": "No router matched the notification request"
        },
        "requestNotificationId": {
          "maxLength": 36,
          "minLength": 36,
          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
          "type": "string",
          "description": "The notification request ID that triggered this delivery, used to correlate delivery outcomes with their originating requests"
        },
        "timestamp": {
          "description": "When the notification was triggered",
          "format": "date-time",
          "maxLength": 30,
          "minLength": 20,
          "type": "string",
          "x-coralogix-presence": true
        }
      },
      "description": "Delivery results for a single notification."
    },
    "RoutedDelivery": {
      "title": "Routed delivery",
      "required": [
        "router",
        "attempts"
      ],
      "type": "object",
      "properties": {
        "attempts": {
          "maxItems": 100,
          "minItems": 0,
          "type": "array",
          "items": {
            "$ref": "#/$defs/DeliveryAttempt"
          },
          "description": "Individual delivery attempts to connectors"
        },
        "router": {
          "allOf": [
            {
              "$ref": "#/$defs/RouterInfo"
            }
          ],
          "description": "The router that handled the notification"
        }
      },
      "description": "Delivery attempts routed through a single router to one or more connectors."
    },
    "RouterInfo": {
      "title": "Router info",
      "required": [
        "routerId",
        "routerName"
      ],
      "type": "object",
      "properties": {
        "routerId": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]*$",
          "type": "string",
          "description": "Unique identifier of the router"
        },
        "routerName": {
          "maxLength": 256,
          "minLength": 1,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Display name of the router"
        }
      },
      "description": "Information about a notification router."
    },
    "v1.ConnectorType": {
      "enum": [
        "CONNECTOR_TYPE_UNSPECIFIED",
        "CONNECTOR_TYPE_SLACK",
        "CONNECTOR_TYPE_SERVICE_NOW",
        "CONNECTOR_TYPE_PAGER_DUTY",
        "CONNECTOR_TYPE_EMAIL",
        "CONNECTOR_TYPE_GENERIC_HTTPS",
        "CONNECTOR_TYPE_MICROSOFT_TEAMS"
      ],
      "type": "string",
      "description": "Connector type."
    }
  }
}