Update a workflow config (compare-and-swap)
PUT
/automation/{id}/config
Needs can_edit_config. 409 automation_config_conflict on a stale revision, 400 config_invalid or config_value_is_id with issues, 413 config_too_large, 409 config_not_available when no published config_schema exists.
Path Parameters
idstring
required·
Resource id
Request Body
expected_revisioninteger
valuesobject
Response Body
can_edit_configboolean
config_blocked_reasonstring,null
draft_schema_differsboolean
revisioninteger
schemaobject,null
The published config_schema, or null when the workflow declares none.
updated_atstring,null
updated_bystring,null
updated_by_namestring,null
valuesobject
curl -X PUT 'https://api.elaichi.ai/automation/<id>/config' \
-H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"expected_revision":0,"values":{}}'const body = {
"expected_revision": 0,
"values": {}
};
const response = await fetch('https://api.elaichi.ai/automation/<id>/config', {
method: 'PUT',
headers: {
'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import os
import requests
url = "https://api.elaichi.ai/automation/<id>/config"
headers = {
"Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
"Content-Type": "application/json",
}
payload = {
"expected_revision": 0,
"values": {}
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())