{
  "$id": "https://docs.honeybadger.io/guides/integrations/payloads/v3/cert_will_expire.schema.json",
  "title": "cert_will_expire webhook payload (v3)",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "#/$defs/WebhookV3CertExpirationEvent",
  "$defs": {
    "WebhookV3CertExpirationEvent": {
      "description": "An uptime site's TLS certificate is about to expire.",
      "allOf": [
        {
          "$ref": "#/$defs/WebhookV3Event"
        },
        {
          "type": "object",
          "required": [
            "site"
          ],
          "properties": {
            "event": {
              "type": "string",
              "enum": [
                "cert_will_expire"
              ]
            },
            "site": {
              "$ref": "#/$defs/WebhookV3Site"
            }
          }
        }
      ]
    },
    "WebhookV3Event": {
      "type": "object",
      "description": "The fields every v3 webhook body carries. Each event adds the records it's about.\n",
      "required": [
        "event",
        "message",
        "payload_version",
        "project",
        "links"
      ],
      "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.",
          "examples": [
            "[Billing API/production] NoMethodError: undefined method 'foo' for nil"
          ]
        },
        "payload_version": {
          "type": "string",
          "const": "v3",
          "description": "The integration's payload version."
        },
        "actor": {
          "allOf": [
            {
              "$ref": "#/$defs/WebhookV3Person"
            }
          ],
          "description": "The person who caused the event. Absent when Honeybadger did."
        },
        "credential": {
          "$ref": "#/$defs/WebhookV3Credential"
        },
        "project": {
          "$ref": "#/$defs/WebhookV3Project"
        },
        "links": {
          "allOf": [
            {
              "$ref": "#/$defs/WebLinks"
            }
          ],
          "description": "The page to open for this event."
        }
      }
    },
    "WebhookV3Person": {
      "type": "object",
      "description": "A person, by ID, name and email.",
      "required": [
        "id",
        "name",
        "email"
      ],
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's ID, or null when the person has no Honeybadger account.\n",
          "examples": [
            "Ur4kTq"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "Jane Doe"
          ]
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "jane@example.com"
          ]
        }
      }
    },
    "WebhookV3Credential": {
      "type": "object",
      "description": "The API token or OAuth grant the event was caused through. Absent when the event wasn't caused through the API.\n",
      "required": [
        "type",
        "id",
        "name"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "`ApiToken` for an API token, `OauthAccessToken` for an OAuth grant.",
          "examples": [
            "ApiToken"
          ]
        },
        "id": {
          "type": "string",
          "examples": [
            "4821"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The token's name. For an OAuth grant, the name the user gave the connection, or the application's name if none.\n",
          "examples": [
            "CI deploys"
          ]
        }
      }
    },
    "WebhookV3Project": {
      "type": "object",
      "description": "The project the event belongs to.",
      "required": [
        "id",
        "name",
        "language",
        "created_at",
        "links"
      ],
      "properties": {
        "id": {
          "type": "string",
          "examples": [
            "Xk9mZp"
          ]
        },
        "name": {
          "type": "string",
          "examples": [
            "Billing API"
          ]
        },
        "language": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "ruby"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "links": {
          "$ref": "#/$defs/WebLinks"
        }
      }
    },
    "WebLinks": {
      "type": "object",
      "description": "Links into the Honeybadger web UI",
      "readOnly": true,
      "required": [
        "web"
      ],
      "properties": {
        "web": {
          "type": "string",
          "format": "uri",
          "description": "The resource's page in the Honeybadger web UI, as an absolute URL. Resources without a page, such as outages and deploys, don't have `links`. For a project provisioned through Heroku, error, notice and comment links go through Heroku's single sign-on.\n",
          "examples": [
            "https://app.honeybadger.io/projects/Xk9mZp"
          ]
        }
      }
    },
    "WebhookV3Site": {
      "type": "object",
      "description": "The uptime site the event is about.",
      "required": [
        "id",
        "project_id",
        "name",
        "url",
        "state",
        "frequency",
        "last_checked_at",
        "created_at",
        "links"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "examples": [
            "9f8b6d2e-4c1a-4b7f-9e35-2a6c8d0f1b47"
          ]
        },
        "project_id": {
          "type": "string",
          "examples": [
            "Xk9mZp"
          ]
        },
        "name": {
          "type": "string",
          "examples": [
            "Checkout"
          ]
        },
        "url": {
          "type": "string",
          "description": "The checked URL, with any credentials in it removed.",
          "examples": [
            "https://example.com/health"
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "pending",
            "up",
            "down"
          ]
        },
        "frequency": {
          "$ref": "#/$defs/SiteFrequency"
        },
        "last_checked_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "links": {
          "$ref": "#/$defs/WebLinks"
        }
      }
    },
    "SiteFrequency": {
      "type": "integer",
      "enum": [
        1,
        2,
        5,
        15
      ],
      "description": "Minutes between checks. A value below the plan's floor is refused."
    }
  }
}
