{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://zosiasec.com/docs/api/webhook.schema.json",
  "title": "Zosia webhook post",
  "description": "The JSON body Zosia posts to a webhook channel's URL for one notification.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique for each post."
    },
    "type": {
      "type": "string",
      "enum": [
        "project.blocked",
        "project.warnings",
        "project.error",
        "project.missing",
        "project.fine",
        "project.connected",
        "project.removed",
        "machine.exploitable",
        "machine.conditional",
        "machine.incomplete",
        "machine.reboot",
        "machine.silent",
        "machine.fine",
        "machine.connected",
        "machine.removed",
        "plan.refused",
        "subscription.changed",
        "subscription.renewal",
        "subscription.ending",
        "reminder",
        "digest",
        "test"
      ],
      "description": "What the post is: an event, a reminder of what stays open, a digest, or a test."
    },
    "subject": {
      "type": "string",
      "description": "What happened, in one line."
    },
    "text": {
      "type": "string",
      "description": "What happened, as plain text."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "The page in Zosia that shows it."
    },
    "sentAt": {
      "type": "string",
      "format": "date-time",
      "description": "When Zosia sent the post, in UTC."
    }
  },
  "required": [
    "id",
    "type",
    "subject",
    "text",
    "url",
    "sentAt"
  ]
}
