# Update an automation rule

Updates an existing automation rule.

When sending an AutomationRule, you must always specify action.type and it must match the existing rule type.

Endpoint: PUT /sheets/{sheetId}/automationrules/{automationRuleId}
Version: 2.0.0
Security: APIToken, OAuth2

## Path parameters:

  - `sheetId` (number, required)
    ID of the sheet being accessed.

  - `automationRuleId` (string, required)
    ID of the automation rule being accessed

## Header parameters:

  - `Authorization` (string)
    API Access Token used to authenticate requests to Smartsheet APIs.

  - `smartsheet-integration-source` (string)
    Uses the following metadata to distinguish between human-initiated API requests and third-party service-initiated calls by AI Connectors or ITSM:

- Integration source type
- Organization name
- Integration source name 

Format:


TYPE,OrgName,SourceName


Examples: 

AI,SampleOrg,My-AI-Connector-v2

SCRIPT,SampleOrg2,Accounting-updater-script

APPLICATION,SampleOrg3,SheetUpdater
    Example: "AI,SampleOrg,My-AI-Connector-v2"

  - `Content-Type` (string)
    Required for POST and PUT requests. Defines the structure for the request body.

## Request fields (application/json):

  - `id` (number)
    AutomationRule ID.

  - `action` (any)
    An [AutomationAction object](/api/smartsheet/openapi/automationrules/automationaction) containing information for this rule, such as type, recipients, and frequency.

  - `createdBy` (object)
    User object containing name and email of the creator of this rule.

  - `createdBy.email` (string)
    Example: "jane.doe@smartsheet.com"

  - `disabledReason` (string)
    Machine-readable reason a rule is disabled:
* APPROVAL_COLUMN_MISSING This rule's approval status column has been deleted.

* APPROVAL_COLUMN_WRONG_TYPE The approval column must be a dropdown column.

* AUTOMATION_NOT_ENABLED_FOR_ORG To create or edit automated actions,
you need to upgrade your organization account to a Business or Enterprise plan.

* COLUMN_MISSING A column referenced by this rule has been deleted.

* COLUMN_TYPE_INCOMPATIBLE A column referenced by this rule has been changed to an incompatible column type.

* NO_POTENTIAL_RECIPIENTS This rule has no recipients that will be able to receive
notifications based on this sheet's permission settings or this account's approved domain sharing list.

* NO_VALID_SELECTED_COLUMNS All selected columns for this rule have been deleted.
    Enum: "APPROVAL_COLUMN_MISSING", "APPROVAL_COLUMN_WRONG_TYPE", "AUTOMATION_NOT_ENABLED_FOR_ORG", "COLUMN_MISSING", "COLUMN_TYPE_INCOMPATIBLE", "NO_POTENTIAL_RECIPIENTS", "NO_VALID_SELECTED_COLUMNS"

  - `disabledReasonText` (string)
    Descriptive reason a rule is disabled.

  - `enabled` (boolean)
    If true, indicates that the rule is active.

  - `modifiedBy` (object)
    User object containing the name and email of the user that made the change.

  - `modifiedBy.email` (string)
    Example: "jane.doe@smartsheet.com"

  - `name` (string)
    Rule name as shown in the UI.

  - `userCanModify` (boolean)
    If true, indicates that the current user can modify the rule.

## Response 200 fields (application/json):

  - `version` (number,null)
    New version of the sheet. Applicable only for operations which update sheet data.

  - `failedItems` (array,null)
    Array of BulkItemFailure objects which represents the items that failed to be added or updated. See [Bulk operations > Partial success](/api/smartsheet/guides/advanced-topics/scalability-options) for more information. Applicable only for bulk operations that support partial success.

  - `failedItems.rowId` (number,null)
    The ID of the row that failed. Applicable only to bulk row operations.

  - `failedItems.error` (object)
    The error caused by the failed item.

  - `failedItems.error.refId` (string)
    The ID of the specific error occurrence. Please include this information when contacting Smartsheet support.

  - `failedItems.error.errorCode` (number)
    Custom error code from Smartsheet. See the complete [Error Code List](/api/smartsheet/error-codes).

  - `failedItems.error.message` (string)
    Descriptive error message.

  - `failedItems.index` (number)
    The index of the failed item in the bulk request array.

  - `message` (string)
    Message that indicates the outcome of the request. (One of SUCCESS or PARTIAL_SUCCESS.)
    Enum: "PARTIAL_SUCCESS", "SUCCESS"

  - `resultCode` (number)
    * '0' Success
* '3' Partial Success of Bulk Operation
    Enum: 0, 3

  - `result` (object)

  - `result.id` (number)
    AutomationRule ID.

  - `result.action` (any)
    An [AutomationAction object](/api/smartsheet/openapi/automationrules/automationaction) containing information for this rule, such as type, recipients, and frequency.

  - `result.createdAt` (any)
    A timestamp of when the rule was originally added.

  - `result.createdBy` (object)
    User object containing name and email of the creator of this rule.

  - `result.createdBy.email` (string)
    Example: "jane.doe@smartsheet.com"

  - `result.createdBy.name` (string)
    Example: "Jane Doe"

  - `result.disabledReason` (string)
    Machine-readable reason a rule is disabled:
* APPROVAL_COLUMN_MISSING This rule's approval status column has been deleted.

* APPROVAL_COLUMN_WRONG_TYPE The approval column must be a dropdown column.

* AUTOMATION_NOT_ENABLED_FOR_ORG To create or edit automated actions,
you need to upgrade your organization account to a Business or Enterprise plan.

* COLUMN_MISSING A column referenced by this rule has been deleted.

* COLUMN_TYPE_INCOMPATIBLE A column referenced by this rule has been changed to an incompatible column type.

* NO_POTENTIAL_RECIPIENTS This rule has no recipients that will be able to receive
notifications based on this sheet's permission settings or this account's approved domain sharing list.

* NO_VALID_SELECTED_COLUMNS All selected columns for this rule have been deleted.
    Enum: "APPROVAL_COLUMN_MISSING", "APPROVAL_COLUMN_WRONG_TYPE", "AUTOMATION_NOT_ENABLED_FOR_ORG", "COLUMN_MISSING", "COLUMN_TYPE_INCOMPATIBLE", "NO_POTENTIAL_RECIPIENTS", "NO_VALID_SELECTED_COLUMNS"

  - `result.disabledReasonText` (string)
    Descriptive reason a rule is disabled.

  - `result.enabled` (boolean)
    If true, indicates that the rule is active.

  - `result.modifiedAt` (any)
    The datetime for when the change was made to the rule.

  - `result.modifiedBy` (object)
    User object containing the name and email of the user that made the change.

  - `result.modifiedBy.email` (string)
    Example: "jane.doe@smartsheet.com"

  - `result.modifiedBy.name` (string)
    Example: "Jane Doe"

  - `result.name` (string)
    Rule name as shown in the UI.

  - `result.userCanModify` (boolean)
    If true, indicates that the current user can modify the rule.


