{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/webex/json-schema/webex-post-auto-attendant-call-forward-selective-rule-object-schema.json",
  "title": "PostAutoAttendantCallForwardSelectiveRuleObject",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/webex-features-auto-attendant-api-openapi.yml#/components/schemas/PostAutoAttendantCallForwardSelectiveRuleObject",
  "type": "object",
  "required": [
    "name",
    "forwardTo",
    "callsFrom"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Unique name for the selective rule in the auto attendant."
    },
    "enabled": {
      "type": "boolean",
      "description": "Reflects if rule is enabled."
    },
    "businessSchedule": {
      "type": "string",
      "description": "Name of the location's business schedule which determines when this selective call forwarding rule is in effect."
    },
    "holidaySchedule": {
      "type": "string",
      "description": "Name of the location's holiday schedule which determines when this selective call forwarding rule is in effect."
    },
    "forwardTo": {
      "$ref": "#/$defs/CallForwardSelectiveForwardToObject",
      "description": "Controls what happens when the rule matches including the destination number for the call forwarding."
    },
    "callsFrom": {
      "$ref": "#/$defs/CallForwardSelectiveCallsFromObject",
      "description": "Settings related to the rule matching based on incoming caller ID."
    },
    "callsTo": {
      "$ref": "#/$defs/CallForwardSelectiveCallsToObject",
      "description": "Settings related to the rule matching based on the destination number."
    }
  },
  "$defs": {
    "CallForwardSelectiveCallsFromCustomNumbersObject": {
      "type": "object",
      "required": [
        "privateNumberEnabled",
        "unavailableNumberEnabled",
        "numbers"
      ],
      "properties": {
        "privateNumberEnabled": {
          "type": "boolean",
          "description": "Match if caller ID indicates the call is from a private number."
        },
        "unavailableNumberEnabled": {
          "type": "boolean",
          "description": "Match if callerID is unavailable."
        },
        "numbers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Array of number strings to be matched against incoming caller ID."
        }
      }
    },
    "CallForwardSelectiveCallsFromObject": {
      "type": "object",
      "required": [
        "selection"
      ],
      "properties": {
        "selection": {
          "type": "string",
          "enum": [
            "ANY",
            "CUSTOM"
          ],
          "description": "If `CUSTOM`, use `customNumbers` to specify which incoming caller ID values cause this rule to match. `ANY` means any incoming call matches assuming the rule is in effect based on the associated schedules.\n * `ANY` - Rule matches for calls from any number.\n * `CUSTOM` - Rule matches based on the numbers and options in customNumbers.\n"
        },
        "customNumbers": {
          "$ref": "#/$defs/CallForwardSelectiveCallsFromCustomNumbersObject",
          "description": "Custom rules for matching incoming caller ID information. Mandatory if the selection option is set to `CUSTOM`."
        }
      }
    },
    "CallForwardSelectiveCallsToNumbersObject": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "phoneNumber": {
          "type": "string",
          "description": "AutoCalls To phone number. Either phone number or extension should be present as mandatory."
        },
        "extension": {
          "type": "string",
          "description": "Calls To extension.  Either `phoneNumber` or `extension` is mandatory."
        },
        "type": {
          "type": "string",
          "enum": [
            "PRIMARY",
            "ALTERNATE"
          ],
          "description": "Calls to type options.\n * `PRIMARY` - Indicates that the given `phoneNumber` or `extension` associated with this rule's containing object is a primary number or extension.\n * `ALTERNATE` - Indicates that the given `phoneNumber` or `extension` associated with this rule's containing object is an alternate number or extension.\n"
        }
      }
    },
    "CallForwardSelectiveCallsToObject": {
      "type": "object",
      "properties": {
        "numbers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CallForwardSelectiveCallsToNumbersObject"
          },
          "description": "Array of numbers to be matched against the calling destination number."
        }
      }
    },
    "CallForwardSelectiveForwardToObject": {
      "type": "object",
      "required": [
        "selection"
      ],
      "properties": {
        "phoneNumber": {
          "type": "string",
          "description": "Phone number used if selection is `FORWARD_TO_SPECIFIED_NUMBER`."
        },
        "selection": {
          "type": "string",
          "enum": [
            "FORWARD_TO_DEFAULT_NUMBER",
            "FORWARD_TO_SPECIFIED_NUMBER",
            "DO_NOT_FORWARD"
          ],
          "description": "Controls what happens when the rule matches.\n * `FORWARD_TO_DEFAULT_NUMBER` - When the rule matches, forward to the destination for the auto attendant.\n * `FORWARD_TO_SPECIFIED_NUMBER` - When the rule matches, forward to the destination for this rule.\n * `DO_NOT_FORWARD` - When the rule matches, do not forward to another number.\n"
        }
      }
    }
  }
}