{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getbioflow-com/json-schema/getbioflow-com-webhook-delivery-schema.json",
  "title": "WebhookDelivery",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getbioflow-com-openapi.json#/components/schemas/WebhookDelivery",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "event_id": {
      "type": "string"
    },
    "event_type": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "PENDING",
        "SUCCEEDED",
        "FAILED"
      ]
    },
    "attempt_count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "next_attempt_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ],
      "description": "When the next automatic attempt is due (PENDING only)"
    },
    "last_status_code": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "attempts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookAttempt"
      }
    }
  },
  "required": [
    "id",
    "event_id",
    "event_type",
    "status",
    "attempt_count",
    "next_attempt_at",
    "last_status_code",
    "created_at",
    "attempts"
  ],
  "additionalProperties": false,
  "$defs": {
    "WebhookAttempt": {
      "type": "object",
      "properties": {
        "number": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "status_code": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "type": [
            "string",
            "null"
          ]
        },
        "duration_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        }
      },
      "required": [
        "number",
        "status_code",
        "error",
        "duration_ms",
        "at"
      ],
      "additionalProperties": false
    }
  }
}