# Triggered Automations ## Create a triggered automation (state + changeset filter trees) **post** `/v2/prism/{teamId}/{automationObjectType}/triggered_automations` Create a triggered automation (state + changeset filter trees) ### Path Parameters - `teamId: optional string` - `automationObjectType: "message" or "action" or "event" or 6 more` Object types that support triggered automations. Must match the triggered-automation whitelist in @micro/database migrate-sql (TRIGGERED_AUTOMATION_OBJECTS). - `"message"` - `"action"` - `"event"` - `"document"` - `"identity"` - `"linkedin_message"` - `"deal"` - `"organization"` - `"contact"` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `kind: "update" or "lifecycle"` - `"update"` - `"lifecycle"` - `name: string` - `id: optional string` - `actions: optional array of object { type, agent_id, cron_expression, 10 more }` Actions to run when the automation fires; each item has a `type` plus type-specific fields. - `type: "agent" or "webhook" or "wait" or 2 more` - `"agent"` - `"webhook"` - `"wait"` - `"email"` - `"linkedin"` - `agent_id: optional string` Required when `type` is `agent`. The agent to run. - `cron_expression: optional string` wait: cron schedule for the resume time. Exactly one of delay_seconds or cron_expression. - `delay_seconds: optional number` wait: relative delay in seconds. Exactly one of delay_seconds or cron_expression. - `recipient_email_prop_def_id: optional string` Required when `type` is `email`. The property (on the recipient view object) holding the recipient email address. - `recipient_provider_prop_def_id: optional string` Required when `type` is `linkedin`. The property (on the recipient view object) holding the recipient LinkedIn provider id. - `recipient_view_id: optional string` Required when `type` is `email` or `linkedin`. The saved prism view resolved at send time to the recipient audience (its filter re-runs each step, so responders drop out of later drip sends). - `recipient_view_object_type: optional string` Required when `type` is `email` or `linkedin`. Must be `contact` — the recipient audience is a contact view (contacts carry the direct email / linkedin provider property). - `send_as_user_id: optional string` Required when `type` is `email` or `linkedin`. The user (external id) the message is sent as. - `subject: optional string` Required when `type` is `email`. The subject line; rendered as a Liquid template per recipient. - `template_id: optional string` Required when `type` is `email` or `linkedin`. The email-template document whose body is rendered (Liquid) per recipient. - `timezone: optional string` wait: IANA timezone for evaluating cron_expression (optional). - `webhook_id: optional string` Required when `type` is `webhook`. The id of the webhook the event is dispatched to (async) when the automation fires. - `changeset: optional object { combinator, filter }` A changeset filter group (update automations only): a combinator plus an array of transition clauses matching what is changing. Dot-paths (nested reference filters) are NOT permitted — direct properties only. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is a transition clause { slug: { from?: { comparator: value }, to?: { comparator: value } } }. `from` matches the prior value, `to` the new value; an empty body { slug: {} } matches any change to that property. - `created_at: optional string` - `enabled: optional boolean` - `list_id: optional string` - `on_create: optional boolean` Lifecycle automations only. - `on_delete: optional boolean` Lifecycle automations only. - `state: optional object { combinator, filter }` A filter group: a combinator plus an array of slug-based clauses. Dot-paths (e.g. `organization.location`) express nested reference filters. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is { slug: { comparator: value } } - `team_id: optional string` - `updated_at: optional string` - `user_id: optional string` ### Returns - `TriggeredAutomation object { kind, name, id, 11 more }` A triggered automation. `kind` selects the shape: `update` fires on object updates and requires a `changeset` (from/to transition) filter plus an optional `state` precondition; `lifecycle` fires on create and/or delete (`on_create`/`on_delete`) and requires a `state` filter (no changeset). `state` permits dot-paths (nested reference filters); `changeset` is direct properties only. Object type is taken from the path. - `kind: "update" or "lifecycle"` - `"update"` - `"lifecycle"` - `name: string` - `id: optional string` - `actions: optional array of object { type, agent_id, cron_expression, 10 more }` Actions to run when the automation fires; each item has a `type` plus type-specific fields. - `type: "agent" or "webhook" or "wait" or 2 more` - `"agent"` - `"webhook"` - `"wait"` - `"email"` - `"linkedin"` - `agent_id: optional string` Required when `type` is `agent`. The agent to run. - `cron_expression: optional string` wait: cron schedule for the resume time. Exactly one of delay_seconds or cron_expression. - `delay_seconds: optional number` wait: relative delay in seconds. Exactly one of delay_seconds or cron_expression. - `recipient_email_prop_def_id: optional string` Required when `type` is `email`. The property (on the recipient view object) holding the recipient email address. - `recipient_provider_prop_def_id: optional string` Required when `type` is `linkedin`. The property (on the recipient view object) holding the recipient LinkedIn provider id. - `recipient_view_id: optional string` Required when `type` is `email` or `linkedin`. The saved prism view resolved at send time to the recipient audience (its filter re-runs each step, so responders drop out of later drip sends). - `recipient_view_object_type: optional string` Required when `type` is `email` or `linkedin`. Must be `contact` — the recipient audience is a contact view (contacts carry the direct email / linkedin provider property). - `send_as_user_id: optional string` Required when `type` is `email` or `linkedin`. The user (external id) the message is sent as. - `subject: optional string` Required when `type` is `email`. The subject line; rendered as a Liquid template per recipient. - `template_id: optional string` Required when `type` is `email` or `linkedin`. The email-template document whose body is rendered (Liquid) per recipient. - `timezone: optional string` wait: IANA timezone for evaluating cron_expression (optional). - `webhook_id: optional string` Required when `type` is `webhook`. The id of the webhook the event is dispatched to (async) when the automation fires. - `changeset: optional object { combinator, filter }` A changeset filter group (update automations only): a combinator plus an array of transition clauses matching what is changing. Dot-paths (nested reference filters) are NOT permitted — direct properties only. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is a transition clause { slug: { from?: { comparator: value }, to?: { comparator: value } } }. `from` matches the prior value, `to` the new value; an empty body { slug: {} } matches any change to that property. - `created_at: optional string` - `enabled: optional boolean` - `list_id: optional string` - `on_create: optional boolean` Lifecycle automations only. - `on_delete: optional boolean` Lifecycle automations only. - `state: optional object { combinator, filter }` A filter group: a combinator plus an array of slug-based clauses. Dot-paths (e.g. `organization.location`) express nested reference filters. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is { slug: { comparator: value } } - `team_id: optional string` - `updated_at: optional string` - `user_id: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/$AUTOMATION_OBJECT_TYPE/triggered_automations \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "kind": "update", "name": "name" }' ``` #### Response ```json { "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" } ``` ## List triggered automations for an owner **get** `/v2/prism/{teamId}/{automationObjectType}/triggered_automations` List triggered automations for an owner ### Path Parameters - `teamId: optional string` - `automationObjectType: "message" or "action" or "event" or 6 more` Object types that support triggered automations. Must match the triggered-automation whitelist in @micro/database migrate-sql (TRIGGERED_AUTOMATION_OBJECTS). - `"message"` - `"action"` - `"event"` - `"document"` - `"identity"` - `"linkedin_message"` - `"deal"` - `"organization"` - `"contact"` ### Query Parameters - `cursor: optional string` Opaque pagination cursor (from a prior response's next_cursor); supersedes page/limit when present. - `kind: optional "update" or "lifecycle"` Optional filter to a single automation kind. When omitted, both kinds are returned. - `"update"` - `"lifecycle"` - `limit: optional number` Maximum items per page (<= 50; defaults to 50). - `list_id: optional string` List (CRM) id to scope the listing to. When omitted, automations owned by the path team are returned. - `page: optional number` 1-based page number. Prefer cursor. ### Returns - `data: array of TriggeredAutomation` - `kind: "update" or "lifecycle"` - `"update"` - `"lifecycle"` - `name: string` - `id: optional string` - `actions: optional array of object { type, agent_id, cron_expression, 10 more }` Actions to run when the automation fires; each item has a `type` plus type-specific fields. - `type: "agent" or "webhook" or "wait" or 2 more` - `"agent"` - `"webhook"` - `"wait"` - `"email"` - `"linkedin"` - `agent_id: optional string` Required when `type` is `agent`. The agent to run. - `cron_expression: optional string` wait: cron schedule for the resume time. Exactly one of delay_seconds or cron_expression. - `delay_seconds: optional number` wait: relative delay in seconds. Exactly one of delay_seconds or cron_expression. - `recipient_email_prop_def_id: optional string` Required when `type` is `email`. The property (on the recipient view object) holding the recipient email address. - `recipient_provider_prop_def_id: optional string` Required when `type` is `linkedin`. The property (on the recipient view object) holding the recipient LinkedIn provider id. - `recipient_view_id: optional string` Required when `type` is `email` or `linkedin`. The saved prism view resolved at send time to the recipient audience (its filter re-runs each step, so responders drop out of later drip sends). - `recipient_view_object_type: optional string` Required when `type` is `email` or `linkedin`. Must be `contact` — the recipient audience is a contact view (contacts carry the direct email / linkedin provider property). - `send_as_user_id: optional string` Required when `type` is `email` or `linkedin`. The user (external id) the message is sent as. - `subject: optional string` Required when `type` is `email`. The subject line; rendered as a Liquid template per recipient. - `template_id: optional string` Required when `type` is `email` or `linkedin`. The email-template document whose body is rendered (Liquid) per recipient. - `timezone: optional string` wait: IANA timezone for evaluating cron_expression (optional). - `webhook_id: optional string` Required when `type` is `webhook`. The id of the webhook the event is dispatched to (async) when the automation fires. - `changeset: optional object { combinator, filter }` A changeset filter group (update automations only): a combinator plus an array of transition clauses matching what is changing. Dot-paths (nested reference filters) are NOT permitted — direct properties only. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is a transition clause { slug: { from?: { comparator: value }, to?: { comparator: value } } }. `from` matches the prior value, `to` the new value; an empty body { slug: {} } matches any change to that property. - `created_at: optional string` - `enabled: optional boolean` - `list_id: optional string` - `on_create: optional boolean` Lifecycle automations only. - `on_delete: optional boolean` Lifecycle automations only. - `state: optional object { combinator, filter }` A filter group: a combinator plus an array of slug-based clauses. Dot-paths (e.g. `organization.location`) express nested reference filters. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is { slug: { comparator: value } } - `team_id: optional string` - `updated_at: optional string` - `user_id: optional string` - `has_more: boolean` True if more automations exist beyond this page. - `next_cursor: optional string` Opaque cursor for the next page; null when has_more is false. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/$AUTOMATION_OBJECT_TYPE/triggered_automations \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "data": [ { "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" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Read a triggered automation **get** `/v2/prism/{teamId}/{automationObjectType}/triggered_automations/{automationId}` Read a triggered automation ### Path Parameters - `teamId: optional string` - `automationObjectType: "message" or "action" or "event" or 6 more` Object types that support triggered automations. Must match the triggered-automation whitelist in @micro/database migrate-sql (TRIGGERED_AUTOMATION_OBJECTS). - `"message"` - `"action"` - `"event"` - `"document"` - `"identity"` - `"linkedin_message"` - `"deal"` - `"organization"` - `"contact"` - `automationId: string` ### Returns - `TriggeredAutomation object { kind, name, id, 11 more }` A triggered automation. `kind` selects the shape: `update` fires on object updates and requires a `changeset` (from/to transition) filter plus an optional `state` precondition; `lifecycle` fires on create and/or delete (`on_create`/`on_delete`) and requires a `state` filter (no changeset). `state` permits dot-paths (nested reference filters); `changeset` is direct properties only. Object type is taken from the path. - `kind: "update" or "lifecycle"` - `"update"` - `"lifecycle"` - `name: string` - `id: optional string` - `actions: optional array of object { type, agent_id, cron_expression, 10 more }` Actions to run when the automation fires; each item has a `type` plus type-specific fields. - `type: "agent" or "webhook" or "wait" or 2 more` - `"agent"` - `"webhook"` - `"wait"` - `"email"` - `"linkedin"` - `agent_id: optional string` Required when `type` is `agent`. The agent to run. - `cron_expression: optional string` wait: cron schedule for the resume time. Exactly one of delay_seconds or cron_expression. - `delay_seconds: optional number` wait: relative delay in seconds. Exactly one of delay_seconds or cron_expression. - `recipient_email_prop_def_id: optional string` Required when `type` is `email`. The property (on the recipient view object) holding the recipient email address. - `recipient_provider_prop_def_id: optional string` Required when `type` is `linkedin`. The property (on the recipient view object) holding the recipient LinkedIn provider id. - `recipient_view_id: optional string` Required when `type` is `email` or `linkedin`. The saved prism view resolved at send time to the recipient audience (its filter re-runs each step, so responders drop out of later drip sends). - `recipient_view_object_type: optional string` Required when `type` is `email` or `linkedin`. Must be `contact` — the recipient audience is a contact view (contacts carry the direct email / linkedin provider property). - `send_as_user_id: optional string` Required when `type` is `email` or `linkedin`. The user (external id) the message is sent as. - `subject: optional string` Required when `type` is `email`. The subject line; rendered as a Liquid template per recipient. - `template_id: optional string` Required when `type` is `email` or `linkedin`. The email-template document whose body is rendered (Liquid) per recipient. - `timezone: optional string` wait: IANA timezone for evaluating cron_expression (optional). - `webhook_id: optional string` Required when `type` is `webhook`. The id of the webhook the event is dispatched to (async) when the automation fires. - `changeset: optional object { combinator, filter }` A changeset filter group (update automations only): a combinator plus an array of transition clauses matching what is changing. Dot-paths (nested reference filters) are NOT permitted — direct properties only. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is a transition clause { slug: { from?: { comparator: value }, to?: { comparator: value } } }. `from` matches the prior value, `to` the new value; an empty body { slug: {} } matches any change to that property. - `created_at: optional string` - `enabled: optional boolean` - `list_id: optional string` - `on_create: optional boolean` Lifecycle automations only. - `on_delete: optional boolean` Lifecycle automations only. - `state: optional object { combinator, filter }` A filter group: a combinator plus an array of slug-based clauses. Dot-paths (e.g. `organization.location`) express nested reference filters. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is { slug: { comparator: value } } - `team_id: optional string` - `updated_at: optional string` - `user_id: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/$AUTOMATION_OBJECT_TYPE/triggered_automations/$AUTOMATION_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "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" } ``` ## Replace a triggered automation (idempotent full write of the whole tree) **put** `/v2/prism/{teamId}/{automationObjectType}/triggered_automations/{automationId}` Replace a triggered automation (idempotent full write of the whole tree) ### Path Parameters - `teamId: optional string` - `automationObjectType: "message" or "action" or "event" or 6 more` Object types that support triggered automations. Must match the triggered-automation whitelist in @micro/database migrate-sql (TRIGGERED_AUTOMATION_OBJECTS). - `"message"` - `"action"` - `"event"` - `"document"` - `"identity"` - `"linkedin_message"` - `"deal"` - `"organization"` - `"contact"` - `automationId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `kind: "update" or "lifecycle"` - `"update"` - `"lifecycle"` - `name: string` - `id: optional string` - `actions: optional array of object { type, agent_id, cron_expression, 10 more }` Actions to run when the automation fires; each item has a `type` plus type-specific fields. - `type: "agent" or "webhook" or "wait" or 2 more` - `"agent"` - `"webhook"` - `"wait"` - `"email"` - `"linkedin"` - `agent_id: optional string` Required when `type` is `agent`. The agent to run. - `cron_expression: optional string` wait: cron schedule for the resume time. Exactly one of delay_seconds or cron_expression. - `delay_seconds: optional number` wait: relative delay in seconds. Exactly one of delay_seconds or cron_expression. - `recipient_email_prop_def_id: optional string` Required when `type` is `email`. The property (on the recipient view object) holding the recipient email address. - `recipient_provider_prop_def_id: optional string` Required when `type` is `linkedin`. The property (on the recipient view object) holding the recipient LinkedIn provider id. - `recipient_view_id: optional string` Required when `type` is `email` or `linkedin`. The saved prism view resolved at send time to the recipient audience (its filter re-runs each step, so responders drop out of later drip sends). - `recipient_view_object_type: optional string` Required when `type` is `email` or `linkedin`. Must be `contact` — the recipient audience is a contact view (contacts carry the direct email / linkedin provider property). - `send_as_user_id: optional string` Required when `type` is `email` or `linkedin`. The user (external id) the message is sent as. - `subject: optional string` Required when `type` is `email`. The subject line; rendered as a Liquid template per recipient. - `template_id: optional string` Required when `type` is `email` or `linkedin`. The email-template document whose body is rendered (Liquid) per recipient. - `timezone: optional string` wait: IANA timezone for evaluating cron_expression (optional). - `webhook_id: optional string` Required when `type` is `webhook`. The id of the webhook the event is dispatched to (async) when the automation fires. - `changeset: optional object { combinator, filter }` A changeset filter group (update automations only): a combinator plus an array of transition clauses matching what is changing. Dot-paths (nested reference filters) are NOT permitted — direct properties only. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is a transition clause { slug: { from?: { comparator: value }, to?: { comparator: value } } }. `from` matches the prior value, `to` the new value; an empty body { slug: {} } matches any change to that property. - `created_at: optional string` - `enabled: optional boolean` - `list_id: optional string` - `on_create: optional boolean` Lifecycle automations only. - `on_delete: optional boolean` Lifecycle automations only. - `state: optional object { combinator, filter }` A filter group: a combinator plus an array of slug-based clauses. Dot-paths (e.g. `organization.location`) express nested reference filters. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is { slug: { comparator: value } } - `team_id: optional string` - `updated_at: optional string` - `user_id: optional string` ### Returns - `TriggeredAutomation object { kind, name, id, 11 more }` A triggered automation. `kind` selects the shape: `update` fires on object updates and requires a `changeset` (from/to transition) filter plus an optional `state` precondition; `lifecycle` fires on create and/or delete (`on_create`/`on_delete`) and requires a `state` filter (no changeset). `state` permits dot-paths (nested reference filters); `changeset` is direct properties only. Object type is taken from the path. - `kind: "update" or "lifecycle"` - `"update"` - `"lifecycle"` - `name: string` - `id: optional string` - `actions: optional array of object { type, agent_id, cron_expression, 10 more }` Actions to run when the automation fires; each item has a `type` plus type-specific fields. - `type: "agent" or "webhook" or "wait" or 2 more` - `"agent"` - `"webhook"` - `"wait"` - `"email"` - `"linkedin"` - `agent_id: optional string` Required when `type` is `agent`. The agent to run. - `cron_expression: optional string` wait: cron schedule for the resume time. Exactly one of delay_seconds or cron_expression. - `delay_seconds: optional number` wait: relative delay in seconds. Exactly one of delay_seconds or cron_expression. - `recipient_email_prop_def_id: optional string` Required when `type` is `email`. The property (on the recipient view object) holding the recipient email address. - `recipient_provider_prop_def_id: optional string` Required when `type` is `linkedin`. The property (on the recipient view object) holding the recipient LinkedIn provider id. - `recipient_view_id: optional string` Required when `type` is `email` or `linkedin`. The saved prism view resolved at send time to the recipient audience (its filter re-runs each step, so responders drop out of later drip sends). - `recipient_view_object_type: optional string` Required when `type` is `email` or `linkedin`. Must be `contact` — the recipient audience is a contact view (contacts carry the direct email / linkedin provider property). - `send_as_user_id: optional string` Required when `type` is `email` or `linkedin`. The user (external id) the message is sent as. - `subject: optional string` Required when `type` is `email`. The subject line; rendered as a Liquid template per recipient. - `template_id: optional string` Required when `type` is `email` or `linkedin`. The email-template document whose body is rendered (Liquid) per recipient. - `timezone: optional string` wait: IANA timezone for evaluating cron_expression (optional). - `webhook_id: optional string` Required when `type` is `webhook`. The id of the webhook the event is dispatched to (async) when the automation fires. - `changeset: optional object { combinator, filter }` A changeset filter group (update automations only): a combinator plus an array of transition clauses matching what is changing. Dot-paths (nested reference filters) are NOT permitted — direct properties only. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is a transition clause { slug: { from?: { comparator: value }, to?: { comparator: value } } }. `from` matches the prior value, `to` the new value; an empty body { slug: {} } matches any change to that property. - `created_at: optional string` - `enabled: optional boolean` - `list_id: optional string` - `on_create: optional boolean` Lifecycle automations only. - `on_delete: optional boolean` Lifecycle automations only. - `state: optional object { combinator, filter }` A filter group: a combinator plus an array of slug-based clauses. Dot-paths (e.g. `organization.location`) express nested reference filters. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is { slug: { comparator: value } } - `team_id: optional string` - `updated_at: optional string` - `user_id: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/$AUTOMATION_OBJECT_TYPE/triggered_automations/$AUTOMATION_ID \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "kind": "update", "name": "name" }' ``` #### Response ```json { "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" } ``` ## Delete a triggered automation and its filter trees **delete** `/v2/prism/{teamId}/{automationObjectType}/triggered_automations/{automationId}` Delete a triggered automation and its filter trees ### Path Parameters - `teamId: optional string` - `automationObjectType: "message" or "action" or "event" or 6 more` Object types that support triggered automations. Must match the triggered-automation whitelist in @micro/database migrate-sql (TRIGGERED_AUTOMATION_OBJECTS). - `"message"` - `"action"` - `"event"` - `"document"` - `"identity"` - `"linkedin_message"` - `"deal"` - `"organization"` - `"contact"` - `automationId: string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/$AUTOMATION_OBJECT_TYPE/triggered_automations/$AUTOMATION_ID \ -X DELETE \ -H "x-api-key: $MICRO_API_KEY" ``` ## Domain Types ### Triggered Automation - `TriggeredAutomation object { kind, name, id, 11 more }` A triggered automation. `kind` selects the shape: `update` fires on object updates and requires a `changeset` (from/to transition) filter plus an optional `state` precondition; `lifecycle` fires on create and/or delete (`on_create`/`on_delete`) and requires a `state` filter (no changeset). `state` permits dot-paths (nested reference filters); `changeset` is direct properties only. Object type is taken from the path. - `kind: "update" or "lifecycle"` - `"update"` - `"lifecycle"` - `name: string` - `id: optional string` - `actions: optional array of object { type, agent_id, cron_expression, 10 more }` Actions to run when the automation fires; each item has a `type` plus type-specific fields. - `type: "agent" or "webhook" or "wait" or 2 more` - `"agent"` - `"webhook"` - `"wait"` - `"email"` - `"linkedin"` - `agent_id: optional string` Required when `type` is `agent`. The agent to run. - `cron_expression: optional string` wait: cron schedule for the resume time. Exactly one of delay_seconds or cron_expression. - `delay_seconds: optional number` wait: relative delay in seconds. Exactly one of delay_seconds or cron_expression. - `recipient_email_prop_def_id: optional string` Required when `type` is `email`. The property (on the recipient view object) holding the recipient email address. - `recipient_provider_prop_def_id: optional string` Required when `type` is `linkedin`. The property (on the recipient view object) holding the recipient LinkedIn provider id. - `recipient_view_id: optional string` Required when `type` is `email` or `linkedin`. The saved prism view resolved at send time to the recipient audience (its filter re-runs each step, so responders drop out of later drip sends). - `recipient_view_object_type: optional string` Required when `type` is `email` or `linkedin`. Must be `contact` — the recipient audience is a contact view (contacts carry the direct email / linkedin provider property). - `send_as_user_id: optional string` Required when `type` is `email` or `linkedin`. The user (external id) the message is sent as. - `subject: optional string` Required when `type` is `email`. The subject line; rendered as a Liquid template per recipient. - `template_id: optional string` Required when `type` is `email` or `linkedin`. The email-template document whose body is rendered (Liquid) per recipient. - `timezone: optional string` wait: IANA timezone for evaluating cron_expression (optional). - `webhook_id: optional string` Required when `type` is `webhook`. The id of the webhook the event is dispatched to (async) when the automation fires. - `changeset: optional object { combinator, filter }` A changeset filter group (update automations only): a combinator plus an array of transition clauses matching what is changing. Dot-paths (nested reference filters) are NOT permitted — direct properties only. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is a transition clause { slug: { from?: { comparator: value }, to?: { comparator: value } } }. `from` matches the prior value, `to` the new value; an empty body { slug: {} } matches any change to that property. - `created_at: optional string` - `enabled: optional boolean` - `list_id: optional string` - `on_create: optional boolean` Lifecycle automations only. - `on_delete: optional boolean` Lifecycle automations only. - `state: optional object { combinator, filter }` A filter group: a combinator plus an array of slug-based clauses. Dot-paths (e.g. `organization.location`) express nested reference filters. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is { slug: { comparator: value } } - `team_id: optional string` - `updated_at: optional string` - `user_id: optional string` ### Triggered Automation List Response - `TriggeredAutomationListResponse object { data, has_more, next_cursor }` - `data: array of TriggeredAutomation` - `kind: "update" or "lifecycle"` - `"update"` - `"lifecycle"` - `name: string` - `id: optional string` - `actions: optional array of object { type, agent_id, cron_expression, 10 more }` Actions to run when the automation fires; each item has a `type` plus type-specific fields. - `type: "agent" or "webhook" or "wait" or 2 more` - `"agent"` - `"webhook"` - `"wait"` - `"email"` - `"linkedin"` - `agent_id: optional string` Required when `type` is `agent`. The agent to run. - `cron_expression: optional string` wait: cron schedule for the resume time. Exactly one of delay_seconds or cron_expression. - `delay_seconds: optional number` wait: relative delay in seconds. Exactly one of delay_seconds or cron_expression. - `recipient_email_prop_def_id: optional string` Required when `type` is `email`. The property (on the recipient view object) holding the recipient email address. - `recipient_provider_prop_def_id: optional string` Required when `type` is `linkedin`. The property (on the recipient view object) holding the recipient LinkedIn provider id. - `recipient_view_id: optional string` Required when `type` is `email` or `linkedin`. The saved prism view resolved at send time to the recipient audience (its filter re-runs each step, so responders drop out of later drip sends). - `recipient_view_object_type: optional string` Required when `type` is `email` or `linkedin`. Must be `contact` — the recipient audience is a contact view (contacts carry the direct email / linkedin provider property). - `send_as_user_id: optional string` Required when `type` is `email` or `linkedin`. The user (external id) the message is sent as. - `subject: optional string` Required when `type` is `email`. The subject line; rendered as a Liquid template per recipient. - `template_id: optional string` Required when `type` is `email` or `linkedin`. The email-template document whose body is rendered (Liquid) per recipient. - `timezone: optional string` wait: IANA timezone for evaluating cron_expression (optional). - `webhook_id: optional string` Required when `type` is `webhook`. The id of the webhook the event is dispatched to (async) when the automation fires. - `changeset: optional object { combinator, filter }` A changeset filter group (update automations only): a combinator plus an array of transition clauses matching what is changing. Dot-paths (nested reference filters) are NOT permitted — direct properties only. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is a transition clause { slug: { from?: { comparator: value }, to?: { comparator: value } } }. `from` matches the prior value, `to` the new value; an empty body { slug: {} } matches any change to that property. - `created_at: optional string` - `enabled: optional boolean` - `list_id: optional string` - `on_create: optional boolean` Lifecycle automations only. - `on_delete: optional boolean` Lifecycle automations only. - `state: optional object { combinator, filter }` A filter group: a combinator plus an array of slug-based clauses. Dot-paths (e.g. `organization.location`) express nested reference filters. - `combinator: optional "AND" or "OR"` - `"AND"` - `"OR"` - `filter: optional array of map[unknown]` Each entry is { slug: { comparator: value } } - `team_id: optional string` - `updated_at: optional string` - `user_id: optional string` - `has_more: boolean` True if more automations exist beyond this page. - `next_cursor: optional string` Opaque cursor for the next page; null when has_more is false.