{
  "$id": "https://docs.honeybadger.io/guides/integrations/payloads/v2/resolved.schema.json",
  "title": "resolved webhook payload (v2)",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "#/$defs/WebhookV2ResolutionEvent",
  "$defs": {
    "WebhookV2ResolutionEvent": {
      "description": "A fault was resolved or reopened.",
      "allOf": [
        {
          "$ref": "#/$defs/WebhookV2Event"
        },
        {
          "type": "object",
          "required": [
            "fault"
          ],
          "properties": {
            "event": {
              "type": "string",
              "enum": [
                "resolved",
                "unresolved"
              ]
            },
            "fault": {
              "$ref": "#/$defs/WebhookV2Fault"
            }
          }
        }
      ]
    },
    "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"
          ]
        }
      }
    },
    "WebhookV2Fault": {
      "type": "object",
      "description": "The fault (a unique error) the event is about. When the account is inactive, only `id`, `project_id`, `message` and `created_at` are sent.\n",
      "required": [
        "id",
        "project_id",
        "message",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "examples": [
            12345
          ]
        },
        "project_id": {
          "type": "integer",
          "examples": [
            1234
          ]
        },
        "klass": {
          "type": [
            "string",
            "null"
          ],
          "description": "Error class name",
          "examples": [
            "NoMethodError"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "The error message, without the class name.",
          "examples": [
            "undefined method 'foo' for nil"
          ]
        },
        "component": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "UsersController"
          ]
        },
        "action": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "show"
          ]
        },
        "environment": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "production"
          ]
        },
        "resolved": {
          "type": "boolean"
        },
        "ignored": {
          "type": "boolean"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "project_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "comments_count": {
          "type": "integer"
        },
        "notices_count": {
          "type": "integer"
        },
        "last_notice_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "tags": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "assignee": {
          "type": [
            "string",
            "null"
          ],
          "description": "The assignee's email address.",
          "examples": [
            "jane@example.com"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "deploy": {
          "anyOf": [
            {
              "$ref": "#/$defs/WebhookV2Deploy"
            },
            {
              "type": "null"
            }
          ],
          "description": "The latest deploy to the fault's environment."
        }
      }
    },
    "WebhookV2Deploy": {
      "type": "object",
      "description": "A deploy.",
      "required": [
        "environment",
        "revision",
        "repository",
        "local_username",
        "created_at",
        "changelog",
        "url"
      ],
      "properties": {
        "environment": {
          "type": "string",
          "examples": [
            "production"
          ]
        },
        "revision": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "850510ab072102729e6967cf89f28b740c61311b"
          ]
        },
        "repository": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "git@github.com:acme/billing.git"
          ]
        },
        "local_username": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "deploy-bot"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "changelog": {
          "type": [
            "array",
            "null"
          ],
          "description": "Commits in the deploy, as the deploy notification sent them.",
          "items": {}
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}
