{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/CreateIncidentRequest",
  "title": "CreateIncidentRequest",
  "type": "object",
  "required": [
    "message"
  ],
  "properties": {
    "message": {
      "type": "string",
      "maxLength": 130,
      "description": "Message of the incident, limited to 130 characters."
    },
    "description": {
      "type": "string",
      "maxLength": 10000,
      "description": "A detailed description of the incident."
    },
    "responders": {
      "type": "array",
      "description": "Teams that the incident is routed to for response.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the responder team."
          },
          "name": {
            "type": "string",
            "description": "Name of the responder team."
          },
          "type": {
            "type": "string",
            "enum": [
              "team"
            ],
            "description": "Type of responder, must be team."
          }
        }
      }
    },
    "tags": {
      "type": "array",
      "description": "Tags to attach to the incident.",
      "items": {
        "type": "string"
      },
      "maxItems": 20
    },
    "details": {
      "type": "object",
      "description": "Custom key-value pairs to attach to the incident.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "priority": {
      "type": "string",
      "enum": [
        "P1",
        "P2",
        "P3",
        "P4",
        "P5"
      ],
      "description": "Priority level of the incident. P1 is the highest."
    },
    "impactedServices": {
      "type": "array",
      "description": "List of service IDs that are impacted by the incident.",
      "items": {
        "type": "string"
      }
    },
    "statusPageEntry": {
      "type": "object",
      "description": "Status page entry to create with the incident.",
      "properties": {
        "title": {
          "type": "string",
          "description": "Title of the status page entry."
        },
        "detail": {
          "type": "string",
          "description": "Detail message for the status page entry."
        }
      }
    },
    "notifyStakeholders": {
      "type": "boolean",
      "description": "Whether to send notifications to stakeholders."
    }
  }
}