{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/victorops/json-schema/victorops-create-escalation-policy-schema.json",
  "title": "CreateEscalationPolicy",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/victorops-openapi.yml#/components/schemas/CreateEscalationPolicy",
  "type": "object",
  "required": [
    "name",
    "teamSlug",
    "steps"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the escalation policy"
    },
    "teamSlug": {
      "type": "string",
      "description": "The unique identifier for the team to create the policy under.\n\nThe team slug is in the format `team-[\\w\\d]{16}`"
    },
    "ignoreCustomPagingPolicies": {
      "type": "boolean",
      "default": false,
      "description": "True if this policy ignores a user's custom paging policy; this will page the on-call user via their Primary Paging Policy and ignore any custom paging policies they have set. We recommend enabling this if the escalation policy handles high severity incidents."
    },
    "steps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CreateEscalationPolicyGroup"
      },
      "description": "A list of groupings of entries. Each group is a \"step\" in the escalation policy."
    }
  },
  "$defs": {
    "CreateEscalationPolicyEntry": {
      "type": "object",
      "required": [
        "executionType"
      ],
      "properties": {
        "executionType": {
          "type": "string",
          "enum": [
            "rotation_group",
            "rotation_group_next",
            "rotation_group_previous",
            "webhook",
            "user",
            "email",
            "policy_routing"
          ],
          "description": "This is an entry containing only ONE of the available execution types.\n\nIf the executionType provided is one of [rotation_group, rotation_group_next, rotation_group_previous] then you must (and only) provide the rotation group object in the body.\n\nIf the executionType provided is [webhook] then you must (and only) provide the webhook object in the body.\n\nIf the executionType provided is [user] then you must (and only) provide the user object in the body.\n\nIf the executionType provided is [email] then you must (and only) provide the email object in the body.\n\nIf the executionType provided is [policy_routing] then you must (and only) provide the target policy object in the body."
        },
        "rotationGroup": {
          "type": "object",
          "title": "rotationGroup",
          "properties": {
            "slug": {
              "type": "string",
              "description": "The unique identifier for the rotation group that will be executed when this escalation policy step activates.\n\nThe slug is in the format `rtg-[\\w\\d]{16}`\n\nThe rotation group must already exist and can currently only be created in the web application. In the Rotations section, the `/api-public/v1/teams/{team}/rotations` endpoint will return a list of the available rotations. The rotation must exist for the same team used in this escalation policy."
            }
          }
        },
        "webhook": {
          "type": "object",
          "title": "wehook",
          "properties": {
            "slug": {
              "type": "string",
              "description": "The unique identifier for the webhook that will be executed when this escalation policy step activates\n\nThe slug is in the format `wh-[\\w\\d]{16}`\n\nThe webhook must already exist and can currently only be created in the web application. In the Webhooks section, the `/api-public/v1/webhooks` endpoint will return a list of your organization's webhooks."
            }
          }
        },
        "user": {
          "type": "object",
          "title": "user",
          "properties": {
            "username": {
              "type": "string",
              "description": "The unique identifier for the user. This user will be notified when the escalation policy step activates."
            }
          }
        },
        "email": {
          "type": "object",
          "title": "email",
          "properties": {
            "address": {
              "type": "string",
              "description": "The email address that will be notified when this escalation policy step activates.\n\nAny email adress may be provided here."
            }
          }
        },
        "targetPolicy": {
          "type": "object",
          "title": "targetPolicy",
          "description": "The escalation policy to target when executing",
          "properties": {
            "policySlug": {
              "type": "string",
              "description": "The unique slug of another escalation policy that will be executed when this escalation policy step activates.\n\nThe policy slug is simply a reference to another escalation policy that already currently exists. The slug is in the format `pol-[\\w\\d]{16}`"
            }
          }
        }
      }
    },
    "CreateEscalationPolicyGroup": {
      "type": "object",
      "required": [
        "timeout",
        "entries"
      ],
      "properties": {
        "timeout": {
          "type": "integer",
          "description": "The duration in minutes to wait until executing this step since the last step was executed.\n\nThis value may be 0. This implies that this policy step should immediately execute."
        },
        "entries": {
          "type": "array",
          "description": "A list of entries that this escalation policy group encapsulates",
          "items": {
            "$ref": "#/$defs/CreateEscalationPolicyEntry"
          }
        }
      }
    }
  }
}