Is it possible to change Action Trigger value conditions via API?
I need to update threshold values inside Tago from another app.
Hello Andre,
Yes, it is possible to change Action Trigger value conditions via the API. Below is an example using curl to update the triggers of actions:
curl 'https://api.tago.io/action/your-action-id' \ -X 'PUT' \ -H 'accept: application/json, text/plain, */*' \ -H 'content-type: application/json' \ -H 'token: YOUR_ACCOUNT_TOKEN' \ --data-raw '{ "trigger": [ { "is": "=", "value": "9", "value_type": "number", "variable": "temperature", "tag_key": "device_type", "tag_value": "organization", "unlock": false }, { "is": "=", "value": "11", "value_type": "number", "variable": "temperature", "tag_key": "device_type", "tag_value": "organization", "unlock": false } ] }'
This command updates the trigger conditions for the specified action. Replace your-action-id with your actual action ID and YOUR_ACCOUNT_TOKEN with your account token.
It worked @mateus.silva, thanks!