Replace a triggered automation (idempotent full write of the whole tree)
client.triggeredAutomations.update(stringautomationID, TriggeredAutomationUpdateParams { teamId, automationObjectType, kind, 14 more } params, RequestOptionsoptions?): TriggeredAutomation { kind, name, id, 11 more }
PUT/v2/prism/{teamId}/{automationObjectType}/triggered_automations/{automationId}
Replace a triggered automation (idempotent full write of the whole tree)
Replace a triggered automation (idempotent full write of the whole tree)
import Micro from '@micro-so/sdk';
const client = new Micro({
teamID: 'My Team ID',
apiKey: process.env['MICRO_API_KEY'], // This is the default and can be omitted
});
const triggeredAutomation = await client.triggeredAutomations.update(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{
automationObjectType: 'message',
kind: 'update',
name: 'name',
},
);
console.log(triggeredAutomation.id);{
"kind": "update",
"name": "name",
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"actions": [
{
"type": "agent",
"agent_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"cron_expression": "cron_expression",
"delay_seconds": 0,
"recipient_email_prop_def_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"recipient_provider_prop_def_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"recipient_view_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"recipient_view_object_type": "recipient_view_object_type",
"send_as_user_id": "send_as_user_id",
"subject": "subject",
"template_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"timezone": "timezone",
"webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
],
"changeset": {
"combinator": "AND",
"filter": [
{
"foo": "bar"
}
]
},
"created_at": "created_at",
"enabled": true,
"list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"on_create": true,
"on_delete": true,
"state": {
"combinator": "AND",
"filter": [
{
"foo": "bar"
}
]
},
"team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"updated_at": "updated_at",
"user_id": "user_id"
}Returns Examples
{
"kind": "update",
"name": "name",
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"actions": [
{
"type": "agent",
"agent_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"cron_expression": "cron_expression",
"delay_seconds": 0,
"recipient_email_prop_def_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"recipient_provider_prop_def_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"recipient_view_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"recipient_view_object_type": "recipient_view_object_type",
"send_as_user_id": "send_as_user_id",
"subject": "subject",
"template_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"timezone": "timezone",
"webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
],
"changeset": {
"combinator": "AND",
"filter": [
{
"foo": "bar"
}
]
},
"created_at": "created_at",
"enabled": true,
"list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"on_create": true,
"on_delete": true,
"state": {
"combinator": "AND",
"filter": [
{
"foo": "bar"
}
]
},
"team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"updated_at": "updated_at",
"user_id": "user_id"
}