{
  "$id": "https://docs.honeybadger.io/guides/integrations/payloads/v3/volume_spike.schema.json",
  "title": "volume_spike webhook payload (v3)",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "#/$defs/WebhookV3VolumeSpikeEvent",
  "$defs": {
    "WebhookV3VolumeSpikeEvent": {
      "description": "A project's error volume rose well above its usual level.",
      "allOf": [
        {
          "$ref": "#/$defs/WebhookV3Event"
        },
        {
          "type": "object",
          "required": [
            "volume_spike"
          ],
          "properties": {
            "event": {
              "type": "string",
              "enum": [
                "volume_spike"
              ]
            },
            "volume_spike": {
              "$ref": "#/$defs/WebhookV3VolumeSpike"
            }
          }
        }
      ]
    },
    "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"
          ]
        }
      }
    },
    "WebhookV3VolumeSpike": {
      "type": "object",
      "description": "The error volume that triggered the spike alert.",
      "required": [
        "observed",
        "baseline_median",
        "factor",
        "z_score",
        "window_minutes"
      ],
      "properties": {
        "observed": {
          "type": "integer",
          "description": "Errors in the window just checked.",
          "examples": [
            412
          ]
        },
        "baseline_median": {
          "type": "integer",
          "description": "The median for a window of the same length over the baseline.",
          "examples": [
            128
          ]
        },
        "factor": {
          "type": [
            "number",
            "null"
          ],
          "description": "`observed` over `baseline_median`, to one decimal.",
          "examples": [
            3.2
          ]
        },
        "z_score": {
          "type": [
            "number",
            "null"
          ],
          "examples": [
            9.1
          ]
        },
        "window_minutes": {
          "type": "integer",
          "examples": [
            60
          ]
        }
      }
    }
  }
}
