Skip to main content
PATCH
/
api
/
automations
/
{id}
Update an automation
curl --request PATCH \
  --url https://clarus-api.com/api/automations/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "automations",
    "attributes": {
      "event": "<string>",
      "name": "<string>",
      "enabled": true,
      "conditions_changes": [
        {
          "type": "ADD",
          "attributes": {
            "condition_code": "account_id",
            "source_path": "data.account_id",
            "operator": "eq",
            "value": "42"
          }
        }
      ],
      "actions_changes": [
        {
          "type": "ADD",
          "attributes": {
            "destination_type": "email",
            "destination_code": "default",
            "parameters_changes": [
              {
                "type": "ADD",
                "attributes": {
                  "parameter_code": "email_recipient",
                  "value": "[email protected]"
                }
              }
            ]
          }
        }
      ]
    }
  }
}
'
{
  "data": {
    "id": 123,
    "type": "automations",
    "attributes": {
      "resource_name": "goods_out",
      "event": "completed",
      "enabled": true
    }
  }
}

Request Structure

{
  "data": {
    "type": "automations",
    "attributes": {
      "enabled": false,
      "conditions_changes": [
        { "type": "UPDATE", "id": 10, "attributes": { "value": "99" } },
        { "type": "DESTROY", "id": 11 }
      ]
    }
  }
}

Key Fields

FieldRequiredDescription
enabledNoEnable/disable the automation
conditions_changesNoADD/UPDATE/DESTROYUPDATE/DESTROY require id
actions_changesNoADD/UPDATE/DESTROYUPDATE/DESTROY require id

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Path Parameters

id
integer
required

The unique identifier of the automation to update

Body

application/json
data
object
required

Response

Automation updated successfully

data
object