Plan Administration API Code Samples

Selection of code samples that demonstrate the use of the Plan Administration API. Copy and edit these code samples to suit your needs.

When using the code samples, remember to replace:

  • {vanity_name} with your tenant name
  • {api_key} with your API key
  • {security_token} with a valid security token

These code samples may not include all available parameters and request body fields for each endpoint. For the endpoint's full request schema, see "Plan Administration" in API Reference.

Partially update a subplan

Use this sample request to consolidate an existing subplan.

Copy
cURL sample request: Consolidate subplans into the main plan
curl --location --request PATCH 'https://{vanity_name}.api.visier.io/v1alpha/planning/data/plans/26096e86-4f8b-403e-9f05-aad2da09c7c1/scenarios/44b3be0b-f404-44ee-aa2c-5f54a830cbf4' \
-H 'apikey: {api_key}' \
-H 'Cookie: VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-d '{
  "actionType": "Consolidate",
  "consolidateActionPayload": {
    "includedSubPlans": ["74432834-6465-4d63-bd41-d953d45e1f45", "d4acda51-c612-4dc3-9dd3-40916c0109f3", "203578ee-fd5c-42c6-b37e-5c74f844e95c"],
    "autoRollup": true
  }
}'

The response returns whether the subplans were successfully consolidated.

Use this sample request to submit an existing subplan.

Copy
cURL sample request: Submit subplan 93668189-8734-4cd8-b340-e9bb9f4a38f0
curl --location --request PATCH 'https://{vanity_name}.api.visier.io/v1alpha/planning/data/plans/93668189-8734-4cd8-b340-e9bb9f4a38f0/scenarios/44b3be0b-f404-44ee-aa2c-5f54a830cbf4' \
-H 'apikey: {api_key}' \
-H 'Cookie: VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-d '{
    "actionType": "Submit",
    "submitActionPayload": {
        "comment": "by postman"
    }
}'

The response returns whether the subplan was successfully submitted.

Use this sample request to reopen an existing subplan.

Copy
cURL sample request: Reopen subplan 74432834-6465-4d63-bd41-d953d45e1f45
curl --location --request PATCH 'https://{vanity_name}.api.visier.io/v1alpha/planning/data/plans/74432834-6465-4d63-bd41-d953d45e1f45/scenarios/44b3be0b-f404-44ee-aa2c-5f54a830cbf4' \
-H 'apikey: {api_key}' \
-H 'Cookie: VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-d '{
  "actionType": "Reopen",
  "reopenActionPayload": {
  "dueDate": "1752624000000",
  "assignee": "john@jupiter.com"
  }
}'

The response returns whether the subplan was successfully reopened.

Use this sample request to start collaboration.

Copy
cURL sample request: Start collaboration on a main plan
curl --location --request PATCH 'https://{vanity_name}.api.visier.io/v1alpha/planning/data/plans/93668189-8734-4cd8-b340-e9bb9f4a38f0/scenarios/44b3be0b-f404-44ee-aa2c-5f54a830cbf4' \
-H 'apikey: {api_key}' \
-H 'Cookie: VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-d '{
    "actionType": "StartCollaboration",
    "startCollaborationActionPayload": {
        "startDate": 1756849468112,
        "dueDate": 1758059068112
    }
}'

The response returns whether collaboration was successfully started.

Use this sample request to end collaboration.

Copy
cURL sample request: End collaboration
curl --location --request PATCH 'https://{vanity_name}.api.visier.io/v1alpha/planning/data/plans/93668189-8734-4cd8-b340-e9bb9f4a38f0/scenarios/44b3be0b-f404-44ee-aa2c-5f54a830cbf4' \
-H 'apikey: {api_key}' \
-H 'Cookie: VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-d '{
    "actionType": "EndCollaboration",
    "endCollaborationActionPayload": {
        "actionWhenUnconsolidatedPlansExists": "Ignore"
    }
}'

The response returns whether collaboration was successfully ended.