{
  "$id": "https://docs.honeybadger.io/guides/integrations/payloads/v2/cert_will_expire.schema.json",
  "title": "cert_will_expire webhook payload (v2)",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "#/$defs/WebhookV2CertExpirationEvent",
  "$defs": {
    "WebhookV2CertExpirationEvent": {
      "description": "An uptime site's TLS certificate is about to expire.",
      "allOf": [
        {
          "$ref": "#/$defs/WebhookV2Event"
        },
        {
          "type": "object",
          "required": [
            "project",
            "site"
          ],
          "properties": {
            "event": {
              "type": "string",
              "enum": [
                "cert_will_expire"
              ]
            },
            "project": {
              "$ref": "#/$defs/WebhookV2ProjectRef"
            },
            "site": {
              "$ref": "#/$defs/WebhookV2Site"
            }
          }
        }
      ]
    },
    "WebhookV2Event": {
      "type": "object",
      "description": "The fields every v2 webhook body carries. Each event adds the records it's about. A v2 body has no `payload_version`; that's how it differs from the later versions.\n",
      "required": [
        "event",
        "message"
      ],
      "not": {
        "required": [
          "payload_version"
        ]
      },
      "properties": {
        "event": {
          "type": "string",
          "description": "The event's name, the same as its key under `webhooks`.",
          "examples": [
            "occurred"
          ]
        },
        "message": {
          "type": "string",
          "description": "A one-line summary of the event, as notifications show it."
        },
        "actor": {
          "allOf": [
            {
              "$ref": "#/$defs/WebhookV2User"
            }
          ],
          "description": "The person who caused the event. Absent when Honeybadger, or an API token with no user, did."
        }
      }
    },
    "WebhookV2User": {
      "type": "object",
      "description": "A Honeybadger user, or an account by its owner's details.",
      "required": [
        "id",
        "email",
        "name"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "examples": [
            4821
          ]
        },
        "email": {
          "type": "string",
          "examples": [
            "jane@example.com"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "Jane Doe"
          ]
        }
      }
    },
    "WebhookV2ProjectRef": {
      "type": "object",
      "description": "The project the event belongs to, by ID and name.",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "examples": [
            1234
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "Billing API"
          ]
        }
      }
    },
    "WebhookV2Site": {
      "type": "object",
      "description": "The uptime site the event is about.",
      "required": [
        "id",
        "name",
        "url",
        "frequency",
        "match_type",
        "match",
        "state",
        "active",
        "last_checked_at",
        "retries",
        "proxy",
        "cert_will_expire_at",
        "timeout",
        "response_headers",
        "details_url"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "description": "The checked URL, as entered."
        },
        "frequency": {
          "type": "integer",
          "description": "Minutes between checks."
        },
        "match_type": {
          "type": "string",
          "examples": [
            "success"
          ]
        },
        "match": {
          "type": [
            "string",
            "null"
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "pending",
            "up",
            "down"
          ]
        },
        "active": {
          "type": "boolean"
        },
        "last_checked_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "retries": {
          "type": [
            "integer",
            "null"
          ]
        },
        "proxy": {
          "type": "integer"
        },
        "cert_will_expire_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "timeout": {
          "type": [
            "integer",
            "null"
          ]
        },
        "response_headers": {
          "type": [
            "object",
            "null"
          ],
          "description": "Headers the site is set to expect in each check's response."
        },
        "details_url": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}
