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]"
}
}
]
}
}
]
}
}
}
'import requests
url = "https://clarus-api.com/api/automations/{id}"
payload = { "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]"
}
}
]
}
}
]
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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]'}
}
]
}
}
]
}
}
})
};
fetch('https://clarus-api.com/api/automations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "automations",
"attributes": {
"resource_name": "goods_out",
"event": "completed",
"enabled": true
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Automations
Update an automation
Update an existing automation, including adding, updating, or destroying its conditions and actions.
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]"
}
}
]
}
}
]
}
}
}
'import requests
url = "https://clarus-api.com/api/automations/{id}"
payload = { "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]"
}
}
]
}
}
]
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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]'}
}
]
}
}
]
}
}
})
};
fetch('https://clarus-api.com/api/automations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "automations",
"attributes": {
"resource_name": "goods_out",
"event": "completed",
"enabled": true
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "automations",
"attributes": {
"enabled": false,
"conditions_changes": [
{ "type": "UPDATE", "id": 10, "attributes": { "value": "99" } },
{ "type": "DESTROY", "id": 11 }
]
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
enabled | No | Enable/disable the automation |
conditions_changes | No | ADD/UPDATE/DESTROY — UPDATE/DESTROY require id |
actions_changes | No | ADD/UPDATE/DESTROY — UPDATE/DESTROY require id |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The unique identifier of the automation to update
Body
application/json
Show child attributes
Show child attributes
Response
Automation updated successfully
Show child attributes
Show child attributes
⌘I

