{
  "$id": "https://docs.honeybadger.io/guides/integrations/payloads/v3/occurred.schema.json",
  "title": "occurred webhook payload (v3)",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "#/$defs/WebhookV3OccurredEvent",
  "$defs": {
    "WebhookV3OccurredEvent": {
      "description": "An error occurred, or a fault passed its notification rate threshold.",
      "allOf": [
        {
          "$ref": "#/$defs/WebhookV3Event"
        },
        {
          "type": "object",
          "required": [
            "fault",
            "notice"
          ],
          "properties": {
            "event": {
              "type": "string",
              "enum": [
                "occurred",
                "rate_exceeded"
              ]
            },
            "fault": {
              "$ref": "#/$defs/WebhookV3Fault"
            },
            "notice": {
              "$ref": "#/$defs/WebhookV3Notice"
            }
          }
        }
      ]
    },
    "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"
          ]
        }
      }
    },
    "WebhookV3Fault": {
      "type": "object",
      "description": "The fault (a unique error) the event is about.",
      "required": [
        "id",
        "project_id",
        "klass",
        "message",
        "component",
        "action",
        "environment",
        "resolved",
        "ignored",
        "tags",
        "assignee",
        "notices_count",
        "created_at",
        "last_notice_at",
        "links"
      ],
      "properties": {
        "id": {
          "type": "string",
          "examples": [
            "12345"
          ]
        },
        "project_id": {
          "type": "string",
          "examples": [
            "Xk9mZp"
          ]
        },
        "klass": {
          "type": [
            "string",
            "null"
          ],
          "description": "Error class name",
          "examples": [
            "NoMethodError"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "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"
        },
        "tags": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "assignee": {
          "anyOf": [
            {
              "$ref": "#/$defs/WebhookV3Person"
            },
            {
              "type": "null"
            }
          ]
        },
        "notices_count": {
          "type": "integer"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "last_notice_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "links": {
          "$ref": "#/$defs/WebLinks"
        }
      }
    },
    "WebhookV3Notice": {
      "type": "object",
      "description": "The occurrence that triggered the event.",
      "required": [
        "id",
        "fault_id",
        "project_id",
        "environment",
        "message",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "examples": [
            "f3a1c2d4-5b6e-4f70-8a91-b2c3d4e5f607"
          ]
        },
        "fault_id": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "12345"
          ]
        },
        "project_id": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "Xk9mZp"
          ]
        },
        "environment": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "production"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "undefined method 'foo' for nil"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "links": {
          "$ref": "#/$defs/WebLinks"
        }
      }
    }
  }
}
