Delete Calculation Manager Rule

Deletes the named rule from the repository selected by deleteFrom. The default scope is CALC_MANAGER.

Required Roles

Service Administrator

REST Resource

DELETE /HyperionPlanning/rest/v3/applications/{application}/calcmanager/rules/{idorname}

Deletion scope and resulting state

The default deleteFrom value is CALC_MANAGER. Omitting the parameter does not remove both copies of an artifact.

Table 3-226 Deletion scope and resulting state

deleteFrom Calculation Manager Planning
CALC_MANAGER Delete the definition from Calculation Manager. Leave any deployed Planning artifact in place.
PLANNING Leave the Calculation Manager definition in place. Delete the deployed artifact from Planning.
BOTH Delete from Calculation Manager first. Then delete from Planning. The operations are not atomic across repositories.

BOTH deletes from Calculation Manager before deleting from Planning. Do not assume a transaction or rollback across the repositories: if the later Planning deletion fails, the Calculation Manager deletion may already have completed. Inspect the repository state before retrying.

A rule deletion is blocked when the server finds a matching Planning ruleset reference. It does not cascade-delete that ruleset. Review and resolve the referencing ruleset before requesting the rule deletion again.

When deleting an undeployed rule by name from Calculation Manager, supply planType so the rule can be retrieved. This applies to a request whose scope includes Calculation Manager; an optional query parameter is not sufficient wording for this conditional requirement.

Plan-type identifiers

Use the application's plan-type name for planType, for example Plan1. The examples assume HP1 contains that plan type. Substitute the corresponding plan-type name from your application. A display name or a different Essbase cube name is not an interchangeable identifier for these operations.

Rule List, Get, Deploy, and existing-artifact Validate operations require the planType query parameter. Rule deletion has a conditional requirement: supply it when deleting an undeployed rule by name from Calculation Manager.

Package bodies identify rule locations through rules[].planType, applicable variable-scope fields, and RULE-step targetPlanType. Examples identify a primary rule explicitly with primaryArtifact.planType. PUT selects the rule location from the package body; do not add a planType query parameter to a Replace request.

Ruleset resource methods do not expose the same planType query parameter as rule methods. Rule definitions and RULE steps included inside a ruleset package still carry their own plan-type names.

Request

For package field definitions, types, values, and content conditions, see Package variables and references and Nonempty variable and reference examples in this topic. Follow this operation's own request-body requirements.

Use HTTP Basic authentication. No request body is required.

Table 3-227 Request Parameters

Name Description Location JSON Type Required Default
application The name of the application. Path string Yes None
idorname The rule name. Percent-encode spaces and reserved characters when the name appears in the URL path. Path string Yes None
planType The plan-type location of the rule. Required when deleting an undeployed rule by name from Calculation Manager; the server needs this location to retrieve it. Supply it explicitly in rule-by-name examples. Query string Conditional; see description None
deleteFrom CALC_MANAGER, PLANNING, or BOTH. Omission defaults to CALC_MANAGER and leaves deployed Planning artifacts in place. See Deletion scope and resulting state. Query string No CALC_MANAGER

Example URL

https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets?planType=Plan1&deleteFrom=CALC_MANAGER

Response

204 No Content; no response body.

Sample Response

No response body is returned.

Package variables and references

This embedded reference describes the package structure shared by the Calculation Manager artifact operations. It does not change an operation's request-body requirements: create, replace, and payload validation accept package bodies; existing-artifact validation uses its documented prompt-value body, and GET, list, delete, and deploy do not accept a replacement package just because this reference is included.

Table 3-228 Package structure

Property JSON Type Description and conditions
primaryArtifact object Primary type/name and rule plan type. RULE endpoints require RULE and exactly one rule definition, with no ruleset definitions. RULESET endpoints require RULESET and its matching definition in rulesets.
variables array of objects Variable definitions available to references in this package. Define every referenced variable in this array.
rules array of objects Rule definitions with name, planType, script, optional displayLabel/executionOptions, and variableReferences.
rulesets array of objects Ruleset definitions with name, mergeVariables, steps, and variableReferences. Include every nested RULESET definition.
links array of objects Response links where populated; not a writable package property.

Table 3-229 Variable definition: variables[]

Property JSON Type Description and conditions
name string Required variable name. Duplicate variable names in the package are rejected.
scope object Required scope descriptor; see the scope table.
dataType string Required. Supported values are listed below.
promptText string Optional text displayed for the runtime prompt.
defaultValue string Optional runtime-prompt default value, represented as a string.
useLastValue boolean Optional preference to reuse the last value where supported.
allowMissing boolean Optional missing-value setting for the variable.
dimension string Dimension name for dimension-dependent prompts. MEMBER/MEMBERS require dimension information.
dimensionType string Dimension-type identifier when using dimension-type-based input; do not substitute an arbitrary label.
dimensionInputMode string NAME or TYPE. Use the dimension name for NAME and corresponding dimension-type information for TYPE.
dynamicMemberParent string Optional parent setting for dynamic-member prompts where applicable.
limits object Optional tagged limit object: LIST, EXPRESSION, SMARTLIST, or MINMAX.
coordinates array of objects Coordinate prompt entries for coordinate-based types such as CELL_REFERENCE and MEMBER_RANGE; see coordinate fields below.

Supported data types: STRING, STRING_AS_NUMBER, INTEGER, NUMERIC, REAL, PERCENT, DATE_AS_NUMBER, DIMENSION, MEMBER, MEMBERS, CELL_REFERENCE, MEMBER_RANGE, and SMARTLIST.

Table 3-230 Variable scope: variables[].scope

Property JSON Type Description and conditions
level string Required: APPLICATION, PLAN_TYPE, RULE, or RULESET.
planType string Supply the application plan-type name for PLAN_TYPE and RULE scopes, such as Plan1.
ruleName string Required targeting information for RULE scope; identifies the rule together with planType.

Table 3-231 Variable limits: variables[].limits

Property JSON Type Description and conditions
kind string Required discriminator: LIST, EXPRESSION, SMARTLIST, or MINMAX.
values array of strings Required for LIST. Example: {"kind":"LIST","values":["Working","Final"]}.
expression string Required for EXPRESSION. Holds the permitted-value expression.
smartListName string Required for SMARTLIST; name of the applicable existing Smart List.
min / max string MINMAX bounds. Supply at least one nonempty bound. Example: {"kind":"MINMAX","min":"0","max":"100"}.

Table 3-232 Coordinate prompt: variables[].coordinates[]

Property JSON Type Description and conditions
dimension string Required dimension for this coordinate prompt.
promptText string Optional prompt text for this coordinate.
defaultExpression string Optional default member-selection expression for this coordinate.

Table 3-233 Rule definition: rules[]

Property JSON Type Description and conditions
name / planType string Rule name and application plan-type name, such as Plan1.
displayLabel string Optional rule display label.
script.language string CALCSCRIPT or GROOVY.
script.source string Script text.
executionOptions object Optional enablePreProcessing, enablePostProcessing, enableNotifications, and disabled boolean flags.
variableReferences array of objects Ordered runtime-prompt references using the fields above.

Table 3-234 Rule variable reference: rules[].variableReferences[]

Property JSON Type Description and conditions
sequence integer Required positive reference sequence. Rule-reference sequence values must be distinct within that rule.
variableName string Required; must resolve to a definition in the package variables array.
hidden boolean Optional setting that hides the runtime prompt.
useAsOverrideValue boolean Optional flag identifying use of an override value for this reference.
overrideValue string Optional reference-specific override value.
validationValue string Optional value for validation substitution. A nonempty validationValue is preferred over overrideValue for validation.
allowMissing boolean Optional missing-value setting at the reference level.

Table 3-235 Ruleset definition: rulesets[]

Property JSON Type Description and conditions
name string Ruleset name; primaryArtifact.name identifies the primary ruleset.
mergeVariables boolean Required setting. true merges common runtime-prompt variables across rule steps; false keeps step-specific prompt references separate. Use rule and step-path targeting for reference-specific values.
steps array of objects Ordered steps with positive sequence, type, targetName, and targetPlanType for RULE. RULESET steps omit targetPlanType and require an included nested ruleset definition.
variableReferences array of objects References targeting rule prompts through stepPath, ruleName, sequence, and variableName.

Table 3-236 Ruleset variable reference: rulesets[].variableReferences[]

Property JSON Type Description and conditions
stepPath array of integers Required nonempty sequence path to the referenced rule step. Values are positive step sequence numbers, not zero-based array indexes. For nested steps, [1,1] follows sequence 1 in the parent and then sequence 1 in the child.
ruleName string Required rule name resolved by stepPath. Rule-name matching is case-insensitive.
sequence integer Required positive variable-reference sequence for the target rule.
variableName string Required variable name defined in this package.
hidden / useAsOverrideValue / allowMissing boolean Optional reference flags, as for rule variable references.
overrideValue / validationValue string Optional reference-specific values, as for rule variable references.

Referenced variable names must resolve within the package. Duplicate names and duplicate reference sequences in the same rule are rejected. Ruleset references must identify valid step paths and rule names; duplicate references for the same step path and variable sequence are rejected. Steps in each ruleset also require distinct sequence values.

Nonempty variable and reference examples

These illustrative packages assume Plan1 and the Version members Working and Final exist. The minimal script isolates variable/reference authoring; it does not demonstrate consuming the prompt in a calculation.

A rule package with one application-scoped member variable and its matching rule reference:

{
  "primaryArtifact": {
    "type": "RULE",
    "name": "Allocate Plan Targets",
    "planType": "Plan1"
  },
  "variables": [
    {
      "name": "TargetVersion",
      "scope": {
        "level": "APPLICATION"
      },
      "dataType": "MEMBER",
      "promptText": "Select target version",
      "defaultValue": "Working",
      "dimension": "Version",
      "dimensionInputMode": "NAME",
      "limits": {
        "kind": "LIST",
        "values": [
          "Working",
          "Final"
        ]
      }
    }
  ],
  "rules": [
    {
      "name": "Allocate Plan Targets",
      "planType": "Plan1",
      "script": {
        "language": "CALCSCRIPT",
        "source": "SET UPDATECALC OFF;"
      },
      "variableReferences": [
        {
          "sequence": 1,
          "variableName": "TargetVersion",
          "hidden": false,
          "useAsOverrideValue": true,
          "overrideValue": "Final",
          "validationValue": "Working",
          "allowMissing": false
        }
      ]
    }
  ],
  "rulesets": []
}

A nested ruleset package with the same variable. The ruleset reference uses stepPath:[1,1] to reach Calc Step through Allocation Steps, and sequence:1 to identify the variable reference in that rule.

{
  "primaryArtifact": {
    "type": "RULESET",
    "name": "Plan Allocation"
  },
  "variables": [
    {
      "name": "TargetVersion",
      "scope": {
        "level": "APPLICATION"
      },
      "dataType": "MEMBER",
      "promptText": "Select target version",
      "defaultValue": "Working",
      "dimension": "Version",
      "dimensionInputMode": "NAME",
      "limits": {
        "kind": "LIST",
        "values": [
          "Working",
          "Final"
        ]
      }
    }
  ],
  "rules": [
    {
      "name": "Calc Step",
      "planType": "Plan1",
      "script": {
        "language": "CALCSCRIPT",
        "source": "SET UPDATECALC OFF;"
      },
      "variableReferences": [
        {
          "sequence": 1,
          "variableName": "TargetVersion",
          "hidden": false,
          "useAsOverrideValue": true,
          "overrideValue": "Final",
          "validationValue": "Working",
          "allowMissing": false
        }
      ]
    }
  ],
  "rulesets": [
    {
      "name": "Plan Allocation",
      "mergeVariables": false,
      "steps": [
        {
          "sequence": 1,
          "type": "RULESET",
          "targetName": "Allocation Steps"
        }
      ],
      "variableReferences": [
        {
          "stepPath": [
            1,
            1
          ],
          "ruleName": "Calc Step",
          "sequence": 1,
          "variableName": "TargetVersion",
          "hidden": false,
          "useAsOverrideValue": true,
          "overrideValue": "Final",
          "validationValue": "Working",
          "allowMissing": false
        }
      ]
    },
    {
      "name": "Allocation Steps",
      "mergeVariables": false,
      "steps": [
        {
          "sequence": 1,
          "type": "RULE",
          "targetName": "Calc Step",
          "targetPlanType": "Plan1"
        }
      ],
      "variableReferences": []
    }
  ]
}

Both examples show separate default, override, and validation values. Working is the variable default and the explicit validation value; Final is the reference override. The nonempty validation value takes precedence for validation substitution.

Deletion scope examples

These are independent alternatives for the same illustrative artifact; they are not a sequence to run against the artifact. The target must exist in the repository selected for deletion. No request body is required.

CALC_MANAGER:

DELETE https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets?planType=Plan1&deleteFrom=CALC_MANAGER

PLANNING:

DELETE https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets?planType=Plan1&deleteFrom=PLANNING

BOTH:

DELETE https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets?planType=Plan1&deleteFrom=BOTH

Deletion failure cases

A missing artifact is a failure case. Check the application, artifact name, selected repository, and, for a rule, the plan-type location. A missing artifact in the second repository does not establish that an earlier deletion was rolled back.

Referenced-rule example: if a Planning ruleset references Allocate Plan Targets, the rule deletion is rejected by the reference check. No cascading deletion of the referencing ruleset occurs. Inspect the actual diagnostic response and resolve the reference.

An error on a BOTH request can leave different repository states. Inspect each repository before retrying rather than assuming neither deletion occurred.

HTTP errors

For common HTTP status definitions, see Error Handling and Status Codes. Inspect the actual response status and diagnostic details when handling a failed request.

Table 3-237 HTTP error cases

HTTP status Condition Action
400 Bad Request Invalid plan-type value or missing conditionally required plan-type location. Supply the applicable plan-type identifier as documented for this operation.
401 Unauthorized Authentication credentials are missing or invalid. Authenticate using a supported method.
403 Forbidden The explicit administrator gate rejects the user. Use a session with the required administrator role.
404 Not Found The requested artifact is not found. Check the application, artifact name, repository context, and any required plan type.
400 Bad Request A matching Planning ruleset reference prevents rule deletion. Resolve the reference; deletion does not cascade to that ruleset.
500 Internal Server Error An unexpected server condition, when reported with this status. Inspect the error details and the resulting artifact state before deciding whether to retry.

Service or transport failures must be handled separately from completed validation results. A successful HTTP response from a validation operation can still report a script-validation error in its JSON body.

Variable settings and field examples

The following examples illustrate scope, limit, coordinate, and option shapes. Referenced artifacts, dimensions, members, and Smart Lists must exist in the target application. Example values do not imply defaults for omitted properties.

Table 3-238 Variable scope examples

Property or object Example Meaning and conditions
APPLICATION scope {"level":"APPLICATION"} Application-scoped variable.
PLAN_TYPE scope {"level":"PLAN_TYPE","planType":"Plan1"} Variable associated with the specified plan-type location.
RULE scope {"level":"RULE","planType":"Plan1","ruleName":"Allocate Plan Targets"} Rule-scoped variable; identifies the rule by name and plan-type location.

Table 3-239 Limits and coordinate examples

Property or object Example Meaning and conditions
LIST limits {"kind":"LIST","values":["Working","Final"]} A list of permitted string values. Use members that exist when the variable is member-valued.
EXPRESSION limits {"kind":"EXPRESSION","expression":"ILvl0Descendants(Version)"} An expression determining the permitted selections; applicable dimensions and members must exist.
SMARTLIST limits {"kind":"SMARTLIST","smartListName":"Planning Status"} Identifies an existing Smart List. This example uses only kind and smartListName.
MINMAX limits {"kind":"MINMAX","min":"0","max":"100"} Bounds are JSON strings; supply at least one nonempty bound.
Coordinate prompt {"dimension":"Version","promptText":"Select version","defaultExpression":"Working"} A coordinate entry contains its dimension and optional prompt/default expression. Place entries inside the variable coordinates array.

Table 3-240 Prompt flags and value precedence

Property or object Example Meaning and conditions
useLastValue true Use the last supplied prompt value where this option applies.
allowMissing false Missing-value allowance at the variable or reference level where supplied.
hidden true Hide this variable reference from runtime prompting.
useAsOverrideValue true Mark the reference to use its supplied override value.
overrideValue "Final" Reference-specific value override.
validationValue "Working" Value used for validation substitution; a nonempty value is preferred over overrideValue for validation.
mergeVariables false Keep step-specific prompt references separate. true merges common prompt variables across ruleset steps.

Table 3-241 Rule executionOptions fields

Property or object Example Meaning and conditions
enablePreProcessing true Enable the rule pre-processing option.
enablePostProcessing true Enable the rule post-processing option.
enableNotifications true Enable the rule notification option.
disabled false Set the rule disabled option. These values configure the rule; they do not launch it.

Supply a limit object matching its kind. Member variables require dimension information, coordinate-based variables require coordinate entries, and reference values must match the variable's supported data type and limits. Rule and ruleset references must resolve to variables defined in the package.

Package examples and lifecycle

These independent examples assume application HP1 has the BSO plan type Plan1, the Version dimension with stored Working and Final members, the Account dimension, and the members Actual, No Entity, P_TP, USD, FY16, and Jan on their corresponding axes. The members must exist and be accessible. The Groovy example requires Groovy business-rule support.

Create examples require new primary artifact names. Replace examples require an existing primary artifact. Adapt member selections and calculation scope to your application.

Minimal rule package:

{
  "primaryArtifact": {
    "type": "RULE",
    "name": "Minimal Rule",
    "planType": "Plan1"
  },
  "variables": [],
  "rules": [
    {
      "name": "Minimal Rule",
      "planType": "Plan1",
      "script": {
        "language": "CALCSCRIPT",
        "source": "SET UPDATECALC OFF;"
      },
      "variableReferences": []
    }
  ],
  "rulesets": []
}

CALCSCRIPT package with a TargetVersion runtime prompt. The calculation fixes on that version and the listed member selections, then calculates the Account dimension.

{
  "primaryArtifact": {
    "type": "RULE",
    "name": "Allocate Plan Targets",
    "planType": "Plan1"
  },
  "variables": [
    {
      "name": "TargetVersion",
      "scope": {
        "level": "APPLICATION"
      },
      "dataType": "MEMBER",
      "promptText": "Select target version",
      "defaultValue": "Working",
      "dimension": "Version",
      "dimensionInputMode": "NAME",
      "limits": {
        "kind": "LIST",
        "values": [
          "Working",
          "Final"
        ]
      }
    }
  ],
  "rules": [
    {
      "name": "Allocate Plan Targets",
      "planType": "Plan1",
      "script": {
        "language": "CALCSCRIPT",
        "source": "SET UPDATECALC OFF;\nFIX ({TargetVersion}, \"Actual\", \"No Entity\", \"P_TP\", \"USD\", \"FY16\", \"Jan\")\n  CALC DIM (\"Account\");\nENDFIX"
      },
      "variableReferences": [
        {
          "sequence": 1,
          "variableName": "TargetVersion",
          "hidden": false,
          "useAsOverrideValue": true,
          "overrideValue": "Final",
          "validationValue": "Working",
          "allowMissing": false
        }
      ]
    }
  ],
  "rulesets": []
}

Groovy package that reads the Plan1 cube name and writes it to the rule log. It defines no runtime prompts; the existing-validation RTP-map path is not used for this example.

{
  "primaryArtifact": {
    "type": "RULE",
    "name": "Inspect Allocation Cube",
    "planType": "Plan1"
  },
  "variables": [],
  "rules": [
    {
      "name": "Inspect Allocation Cube",
      "planType": "Plan1",
      "script": {
        "language": "GROOVY",
        "source": "/* RTPS: */\ndef cube = operation.application.getCube(\"Plan1\")\nprintln \"Allocation cube: ${cube.getName()}\""
      },
      "variableReferences": []
    }
  ],
  "rulesets": []
}

Nested ruleset package with a step-path override. Plan Allocation targets Calc Step through Allocation Steps using stepPath [1,1]. The ruleset reference supplies Final for its override and validation value, while the variable default remains Working.

{
  "primaryArtifact": {
    "type": "RULESET",
    "name": "Plan Allocation"
  },
  "variables": [
    {
      "name": "TargetVersion",
      "scope": {
        "level": "APPLICATION"
      },
      "dataType": "MEMBER",
      "promptText": "Select target version",
      "defaultValue": "Working",
      "dimension": "Version",
      "dimensionInputMode": "NAME",
      "limits": {
        "kind": "LIST",
        "values": [
          "Working",
          "Final"
        ]
      }
    }
  ],
  "rules": [
    {
      "name": "Calc Step",
      "planType": "Plan1",
      "script": {
        "language": "CALCSCRIPT",
        "source": "SET UPDATECALC OFF;\nFIX ({TargetVersion}, \"Actual\", \"No Entity\", \"P_TP\", \"USD\", \"FY16\", \"Jan\")\n  CALC DIM (\"Account\");\nENDFIX"
      },
      "variableReferences": [
        {
          "sequence": 1,
          "variableName": "TargetVersion",
          "hidden": false,
          "useAsOverrideValue": true,
          "overrideValue": "Final",
          "validationValue": "Working",
          "allowMissing": false
        }
      ]
    }
  ],
  "rulesets": [
    {
      "name": "Plan Allocation",
      "mergeVariables": false,
      "steps": [
        {
          "sequence": 1,
          "type": "RULESET",
          "targetName": "Allocation Steps"
        }
      ],
      "variableReferences": [
        {
          "stepPath": [
            1,
            1
          ],
          "ruleName": "Calc Step",
          "sequence": 1,
          "variableName": "TargetVersion",
          "hidden": false,
          "useAsOverrideValue": true,
          "overrideValue": "Final",
          "validationValue": "Final",
          "allowMissing": false
        }
      ]
    },
    {
      "name": "Allocation Steps",
      "mergeVariables": false,
      "steps": [
        {
          "sequence": 1,
          "type": "RULE",
          "targetName": "Calc Step",
          "targetPlanType": "Plan1"
        }
      ],
      "variableReferences": []
    }
  ]
}

Table 3-242 Consistent rule-package lifecycle

Stage Request Input Result handling
Create POST https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules Use the CALCSCRIPT/RTP package below. Read the name-valued id and self link from this response.
GET GET https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets?planType=Plan1 No request body. Retrieve the saved package and preserve its intended definitions.
Validate POST https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets/validate?mode=VALIDATE_ONLY&planType=Plan1 {"rtps":{"TargetVersion":"Working"}} Inspect overall/per-rule status; no deployment in this mode.
Deploy POST https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets/deploy?planType=Plan1 No replacement package body. Read deployed identifiers from this operation response.
Replace PUT https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets Use the replacement package below. Read this response reference; the saved package changes without automatic deployment.
Redeploy POST https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets/deploy?planType=Plan1 No replacement package body. Read identifiers and results from this redeploy response independently.

Use the same Allocate Plan Targets artifact and TargetVersion variable throughout the lifecycle. Obtain response identifiers from each operation. Calculation Manager-only create/replace identifiers and deployed Planning identifiers have different roles; do not carry a fabricated UUID through the sequence or infer UUID lookup support from an identifier returned as response data.

Replacement package for the PUT stage. It retains the intended variable/reference settings and adds SET AGGMISSG ON to the calculation source:

{
  "primaryArtifact": {
    "type": "RULE",
    "name": "Allocate Plan Targets",
    "planType": "Plan1"
  },
  "variables": [
    {
      "name": "TargetVersion",
      "scope": {
        "level": "APPLICATION"
      },
      "dataType": "MEMBER",
      "promptText": "Select target version",
      "defaultValue": "Working",
      "dimension": "Version",
      "dimensionInputMode": "NAME",
      "limits": {
        "kind": "LIST",
        "values": [
          "Working",
          "Final"
        ]
      }
    }
  ],
  "rules": [
    {
      "name": "Allocate Plan Targets",
      "planType": "Plan1",
      "script": {
        "language": "CALCSCRIPT",
        "source": "SET AGGMISSG ON;\nSET UPDATECALC OFF;\nFIX ({TargetVersion}, \"Actual\", \"No Entity\", \"P_TP\", \"USD\", \"FY16\", \"Jan\")\n  CALC DIM (\"Account\");\nENDFIX"
      },
      "variableReferences": [
        {
          "sequence": 1,
          "variableName": "TargetVersion",
          "hidden": false,
          "useAsOverrideValue": true,
          "overrideValue": "Final",
          "validationValue": "Working",
          "allowMissing": false
        }
      ]
    }
  ],
  "rulesets": []
}

Separate validation-failure input: use the complete rule package with its script object changed as shown below, and submit it to the payload-validation endpoint in VALIDATE_ONLY mode. The object below is a script-field fragment, not a complete request body.

POST https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/validate?mode=VALIDATE_ONLY
{
  "language": "CALCSCRIPT",
  "source": "NOT_A_VALID_CALC_COMMAND;"
}

Inspect the actual overall status and per-rule diagnostics. A completed validation can return HTTP 200 with an error result. This validation-only test does not replace the saved package or deploy the invalid script.

Deletion scopes are independent alternatives after the example lifecycle. Select the intended repository scope rather than running all three against the same artifact:

DELETE https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets?planType=Plan1&deleteFrom=CALC_MANAGER
DELETE https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets?planType=Plan1&deleteFrom=PLANNING
DELETE https://<BASE-URL>/HyperionPlanning/rest/v3/applications/HP1/calcmanager/rules/Allocate%20Plan%20Targets?planType=Plan1&deleteFrom=BOTH

CALC_MANAGER leaves the Planning copy in place; PLANNING leaves the Calculation Manager copy in place. BOTH deletes from Calculation Manager first and is not atomic across the repositories. A Planning ruleset reference can block rule deletion.