Skip to content
  • Auto
  • Light
  • Dark
Get Started

Update

Update
client.policies.update(stringid, PolicyUpdateParamsbody?, RequestOptionsoptions?): policyPolicyPolicyUpdateResponse
post/api/v1/policies/{id}

Update a policy by providing a policy object and an update mask.

Parameters
idstring

The ID of the Policy.

bodypolicyPolicyupdateMaskunionPolicyUpdateParams
Hide ParametersShow Parameters
policyidstringcreatedAtstringdeletedAtstringdescriptionstringdisplayNamestringpolicyStepsRecord<string, PolicySteps>policyTypeunionpostActionsunionreassignTasksToDelegatesbooleanrulesunionsystemBuiltinbooleanupdatedAtstringPolicy
optional

A policy describes the behavior of the ConductorOne system when processing a task. You can describe the type, approvers, fallback behavior, and escalation processes.

updateMaskunion
optional
string | null
Returns
PolicyUpdateResponse

The UpdatePolicyResponse message contains the updated policy object.

Hide ParametersShow Parameters
policyidstringcreatedAtstringdeletedAtstringdescriptionstringdisplayNamestringpolicyStepsRecord<string, PolicySteps>policyTypeunionpostActionsunionreassignTasksToDelegatesbooleanrulesunionsystemBuiltinbooleanupdatedAtstringPolicy
optional

A policy describes the behavior of the ConductorOne system when processing a task. You can describe the type, approvers, fallback behavior, and escalation processes.

Request example TypeScript
import ConductoroneSDK from 'conductorone-sdk';

const client = new ConductoroneSDK({
  apiKey: 'My API Key',
});

const policy = await client.policies.update('id');

console.log(policy.policy);
200 Example
{
  "policy": {
    "description": "description",
    "displayName": "displayName",
    "policySteps": {
      "foo": {
        "steps": [
          {
            "accept": {
              "acceptMessage": "acceptMessage"
            },
            "approval": {
              "agent": {
                "agentMode": "APPROVAL_AGENT_MODE_UNSPECIFIED",
                "agentUserId": "agentUserId",
                "instructions": "instructions",
                "policyIds": [
                  "string"
                ]
              },
              "allowedReassignees": [
                "string"
              ],
              "allowReassignment": true,
              "appOwners": {
                "allowSelfApproval": true
              },
              "entitlementOwners": {
                "allowSelfApproval": true,
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "escalation": {
                "escalationComment": "escalationComment",
                "expiration": "expiration",
                "reassignToApprovers": {
                  "approverIds": [
                    "string"
                  ]
                },
                "replacePolicy": {
                  "policyId": "policyId"
                }
              },
              "escalationEnabled": true,
              "expression": {
                "allowSelfApproval": true,
                "expressions": [
                  "string"
                ],
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "group": {
                "allowSelfApproval": true,
                "appGroupId": "appGroupId",
                "appId": "appId",
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "manager": {
                "allowSelfApproval": true,
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "requireApprovalReason": true,
              "requireDenialReason": true,
              "requireReassignmentReason": true,
              "requiresStepUpProviderId": "requiresStepUpProviderId",
              "resourceOwners": {
                "allowSelfApproval": true,
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "self": {
                "fallback": true,
                "fallbackUserIds": [
                  "string"
                ]
              },
              "users": {
                "allowSelfApproval": true,
                "userIds": [
                  "string"
                ]
              },
              "webhook": {
                "webhookId": "webhookId"
              }
            },
            "provision": {
              "assigned": true,
              "provisionPolicy": {
                "connector": {
                  "account": {
                    "config": {
                      "foo": "bar"
                    },
                    "connectorId": "connectorId",
                    "doNotSave": {},
                    "saveToVault": {
                      "vaultIds": [
                        "string"
                      ]
                    },
                    "schemaId": "schemaId"
                  },
                  "defaultBehavior": {
                    "connectorId": "connectorId"
                  },
                  "deleteAccount": {
                    "connectorId": "connectorId"
                  }
                },
                "delegated": {
                  "appId": "appId",
                  "entitlementId": "entitlementId",
                  "implicit": true
                },
                "externalTicket": {
                  "appId": "appId",
                  "connectorId": "connectorId",
                  "externalTicketProvisionerConfigId": "externalTicketProvisionerConfigId",
                  "instructions": "instructions"
                },
                "manual": {
                  "instructions": "instructions",
                  "userIds": [
                    "string"
                  ]
                },
                "unconfigured": {},
                "webhook": {
                  "webhookId": "webhookId"
                }
              },
              "provisionTarget": {
                "appEntitlementId": "appEntitlementId",
                "appId": "appId",
                "appUserId": "appUserId",
                "grantDuration": "grantDuration"
              }
            },
            "reject": {
              "rejectMessage": "rejectMessage"
            },
            "wait": {
              "commentOnFirstWait": "commentOnFirstWait",
              "commentOnTimeout": "commentOnTimeout",
              "condition": {
                "condition": "condition"
              },
              "name": "name",
              "timeoutDuration": "timeoutDuration"
            }
          }
        ]
      }
    },
    "policyType": "POLICY_TYPE_UNSPECIFIED",
    "postActions": [
      {
        "certifyRemediateImmediately": true
      }
    ],
    "reassignTasksToDelegates": true,
    "rules": [
      {
        "condition": "condition",
        "policyKey": "policyKey"
      }
    ]
  }
}