{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beel-es/json-schema/beel-es-email-delivery-indicator-list-response-schema.json",
  "title": "EmailDeliveryIndicatorListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beel-es-accountemails-api-openapi.yml#/components/schemas/EmailDeliveryIndicatorListResponse",
  "type": "object",
  "required": [
    "success",
    "data"
  ],
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "type": "object",
      "required": [
        "indicators"
      ],
      "properties": {
        "indicators": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EmailDeliveryIndicator"
          }
        }
      }
    },
    "meta": {
      "$ref": "#/$defs/ResponseMeta"
    }
  },
  "$defs": {
    "EmailDeliveryIndicator": {
      "type": "object",
      "description": "Summary of the emails recorded for an entity (e.g. an invoice), attempts included.\nUsed to show an \"email sent\" indicator next to each entity without\nloading the full history.\n",
      "required": [
        "related_entity_id",
        "count"
      ],
      "properties": {
        "related_entity_id": {
          "type": "string",
          "format": "uuid",
          "description": "Id of the related entity (e.g. invoice_id)"
        },
        "count": {
          "type": "integer",
          "description": "Number of emails recorded for the entity, whatever their outcome"
        },
        "last_status": {
          "$ref": "#/$defs/EmailDeliveryStatus"
        },
        "last_sent_at": {
          "type": "string",
          "format": "date-time",
          "description": "Time of the last email sent for the entity"
        }
      }
    },
    "EmailDeliveryStatus": {
      "type": "string",
      "enum": [
        "QUEUED",
        "REJECTED",
        "SENT",
        "FAILED",
        "DELIVERED",
        "BOUNCED",
        "OPENED"
      ],
      "description": "Status of an email.\n\nThe history records every email the system decided to send, not only the ones that\nwent out: an email stopped by policy is listed as REJECTED rather than omitted.\n\n- QUEUED: authorised and recorded, not dispatched yet\n- REJECTED: stopped by policy and never sent (terminal, not retried). In test\n  environments invoices may only be emailed to the account owner's own address\n  (`+tag` aliases included), so a message addressed elsewhere lands here\n- SENT: successfully sent to the provider\n- FAILED: sending failed\n- DELIVERED / BOUNCED / OPENED: reported by the provider's webhooks\n"
    },
    "ResponseMeta": {
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "request_id": {
          "type": "string"
        }
      }
    }
  }
}