{
  "$id": "https://docs.honeybadger.io/guides/integrations/payloads/v3/check_in_reporting.schema.json",
  "title": "check_in_reporting webhook payload (v3)",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "#/$defs/WebhookV3CheckInEvent",
  "$defs": {
    "WebhookV3CheckInEvent": {
      "description": "A check-in missed its schedule, or started reporting again.",
      "allOf": [
        {
          "$ref": "#/$defs/WebhookV3Event"
        },
        {
          "type": "object",
          "required": [
            "check_in"
          ],
          "properties": {
            "event": {
              "type": "string",
              "enum": [
                "check_in_missing",
                "check_in_reporting"
              ]
            },
            "check_in": {
              "$ref": "#/$defs/WebhookV3CheckIn"
            }
          }
        }
      ]
    },
    "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"
          ]
        }
      }
    },
    "WebhookV3CheckIn": {
      "type": "object",
      "description": "The check-in the event is about.",
      "required": [
        "id",
        "project_id",
        "name",
        "slug",
        "schedule_type",
        "state",
        "reported_at",
        "expected_at",
        "missed_count",
        "created_at",
        "links"
      ],
      "properties": {
        "id": {
          "type": "string",
          "examples": [
            "Ci5xWq"
          ]
        },
        "project_id": {
          "type": "string",
          "examples": [
            "Xk9mZp"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "Nightly backup"
          ]
        },
        "slug": {
          "type": [
            "string",
            "null"
          ],
          "examples": [
            "nightly-backup"
          ]
        },
        "schedule_type": {
          "$ref": "#/$defs/CheckInScheduleType"
        },
        "state": {
          "type": "string",
          "enum": [
            "pending",
            "reporting",
            "missing",
            "paused"
          ]
        },
        "reported_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "expected_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "missed_count": {
          "type": "integer"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "links": {
          "$ref": "#/$defs/WebLinks"
        }
      }
    },
    "CheckInScheduleType": {
      "type": "string",
      "enum": [
        "simple",
        "cron"
      ],
      "default": "simple",
      "description": "`simple` expects a report every `report_period`. `cron` expects reports on a cron schedule and requires `cron_schedule`.\n"
    }
  }
}
