{
  "$id": "https://docs.honeybadger.io/guides/integrations/payloads/v2/alarm_ok.schema.json",
  "title": "alarm_ok webhook payload (v2)",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "#/$defs/WebhookV2AlarmEvent",
  "$defs": {
    "WebhookV2AlarmEvent": {
      "description": "An Insights alarm was triggered, or returned to normal.",
      "allOf": [
        {
          "$ref": "#/$defs/WebhookV2Event"
        },
        {
          "type": "object",
          "required": [
            "alarm"
          ],
          "properties": {
            "event": {
              "type": "string",
              "enum": [
                "alarm_alert",
                "alarm_ok"
              ]
            },
            "alarm": {
              "$ref": "#/$defs/WebhookV2Alarm"
            }
          }
        }
      ]
    },
    "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"
          ]
        }
      }
    },
    "WebhookV2Alarm": {
      "type": "object",
      "description": "The Insights alarm the event is about.",
      "required": [
        "id",
        "name",
        "state",
        "created_at",
        "url",
        "details_url"
      ],
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "initial",
            "alarm",
            "ok",
            null
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "details_url": {
          "type": "string",
          "format": "uri",
          "description": "The same as `url`."
        }
      }
    }
  }
}
