DevelopersAPI referenceEngagement

Automations API

REST endpoints for automations in SKUFlow: 11 operations with parameters, request and response fields, permissions and curl examples.

Base URL: https://app.skuflow.ai/api. Every call needs Authorization: Bearer skf_… (Authentication); {organizationId} ($ORGANIZATION_ID in the examples) is your business's id.

OperationEndpointRisk
List automationsGET /organizations/{organizationId}/automationsread
Create an automationPOST /organizations/{organizationId}/automationssensitive
List the automation presets (template gallery)GET /organizations/{organizationId}/automations/presetsread
Turn a preset automation onPOST /organizations/{organizationId}/automations/presets/{presetKey}sensitive
Get an automationGET /organizations/{organizationId}/automations/{ruleId}read
Edit an automationPATCH /organizations/{organizationId}/automations/{ruleId}sensitive
Delete an automationDELETE /organizations/{organizationId}/automations/{ruleId}sensitive
Turn an automation on or offPOST /organizations/{organizationId}/automations/{ruleId}/enabledsensitive
An automation's execution logGET /organizations/{organizationId}/automations/{ruleId}/executionsread
An automation's timers (RELATIVE)GET /organizations/{organizationId}/automations/{ruleId}/timersread
Preview an automation for a customerPOST /organizations/{organizationId}/automations/previewwrite

List automations

GET /organizations/{organizationId}/automations

The organization's automations (engagement rules: trigger → conditions → messages → guardrails), on ones first, each with its message stats (sent, delivered, failed, deferred by quiet hours, skipped). Read-only.

Permissionengagement.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolautomations_list (toolset marketing)

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields

An array of objects:

FieldTypeDescription
idstring
namestring
descriptionstring or null
presetKeystring or null
enabledboolean
purposeenumOne of TRANSACTIONAL, MARKETING.
timeCriticalboolean
triggerTypeenumOne of EVENT, SCHEDULE, ABSENCE, RELATIVE.
triggerobjectThe trigger (packages/engagement/schemas.ts TriggerSchema).
audienceobject{ conditionTree? }
actionobjectRecipient, first message, follow-ups, exit events.
frequencyCapHoursinteger or null
lastRunAtstring or nullISO 8601 time (UTC).
nextRunAtstring or nullISO 8601 time (UTC).
executionCountinteger
createdAtstringISO 8601 time (UTC).
updatedAtstringISO 8601 time (UTC).
problemstring or nullWhy the stored settings cannot run, if they cannot.
statsobject
stats.sentintegerSent, sent in test mode, or delivered.
stats.deliveredinteger
stats.failedintegerFailed or bounced.
stats.deferredintegerWaiting for quiet hours to end.
stats.skippedintegerNot sent: consent, caps, missing address or link.
stats.queuedinteger

Create an automation

POST /organizations/{organizationId}/automations

CUSTOMER-FACING when enabled: a rule that messages customers when it fires. Templates named in the action must be this organization's and match the step's channel (GET /message-templates). Created off unless enabled is true.

Permissionengagement.manage (Owner, Admin)
Risksensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolautomations_create (toolset marketing)
PlanAutomated reminders and follow-ups: the Connect plan and up.
ApprovalOver MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals.

Request body

FieldTypeRequiredDescription
namestringYesUp to 200 characters.
descriptionstring or nullNoUp to 1000 characters.
enabledbooleanNoOn = it starts messaging customers when it fires. Default false.
purposeenumNoMARKETING also needs each customer's marketing consent. One of TRANSACTIONAL, MARKETING. Default TRANSACTIONAL.
timeCriticalbooleanNoSent even in quiet hours (time-critical order messages). Default false.
triggerobjectYesEVENT { eventType }, SCHEDULE { frequency, hourLocal, dayOfWeek }, ABSENCE { eventType, absenceDays, hourLocal } or RELATIVE { anchor, direction, amount, unit, hourLocal } (N minutes/hours/days before or after quote.sent or invoice.due).
audienceobjectNo{ conditionTree }: customer, record, event-history and prediction conditions. Default {}.
audience.conditionTreeobjectNo
audience.conditionTree.kindgroupYes
audience.conditionTree.combinatorenumYesOne of and, or.
audience.conditionTree.notbooleanNo
audience.conditionTree.conditionsarray of objectYesUp to 100 items.
actionobjectYes{ recipient: PRIMARY|BILLING, channel, subject?, body? or messageTemplateId, initialDelayHours?, followUps?: [{ channel, delayHours, … }], exitOnEvents? }
action.recipientenumNoOne of PRIMARY, BILLING. Default PRIMARY.
action.channelenumYesOne of EMAIL, SMS.
action.subjectstringNoUp to 200 characters.
action.bodystringNoUp to 5000 characters.
action.messageTemplateIdstringNo
action.initialDelayHoursintegerNo0–8760.
action.followUpsarray of objectNoUp to 9 items.
action.followUps[].channelenumYesOne of EMAIL, SMS.
action.followUps[].delayHoursintegerYes0–8760.
action.followUps[].subjectstringNoUp to 200 characters.
action.followUps[].bodystringNoUp to 5000 characters.
action.followUps[].messageTemplateIdstringNo
action.exitOnEventsarray of enumNoUp to 10 items.
frequencyCapHoursinteger or nullNoAt most one message of this automation per customer in this many hours. 0–8760.

Example

curl -X POST "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Dana Whitfield","trigger":{"type":"SCHEDULE","frequency":"hourly"},"action":{"channel":"EMAIL"}}'

Response

201: the answer's fields
FieldTypeDescription
idstring
namestring
descriptionstring or null
presetKeystring or null
enabledboolean
purposeenumOne of TRANSACTIONAL, MARKETING.
timeCriticalboolean
triggerTypeenumOne of EVENT, SCHEDULE, ABSENCE, RELATIVE.
triggerobjectThe trigger (packages/engagement/schemas.ts TriggerSchema).
audienceobject{ conditionTree? }
actionobjectRecipient, first message, follow-ups, exit events.
frequencyCapHoursinteger or null
lastRunAtstring or nullISO 8601 time (UTC).
nextRunAtstring or nullISO 8601 time (UTC).
executionCountinteger
createdAtstringISO 8601 time (UTC).
updatedAtstringISO 8601 time (UTC).
problemstring or nullWhy the stored settings cannot run, if they cannot.

List the automation presets (template gallery)

GET /organizations/{organizationId}/automations/presets

The automations ready to turn on: request received, quote follow-up, invoice payment link, overdue reminders, payment receipt, review request after payment, referral reward and win-back. Each says whether the organization already has it on and what setup it still needs. Read-only.

Permissionengagement.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolautomations_presets (toolset marketing)

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations/presets" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields

An array of objects:

FieldTypeDescription
keystring
namestring
descriptionstring
whenstringWhat fires it, in words.
purposeenumOne of TRANSACTIONAL, MARKETING.
timeCriticalboolean
channelsarray of enum
stepsinteger
needsarray of stringSetup still missing (e.g. a review link).
ruleIdstring or nullThe automation made from it, when there is one.
enabledboolean

Turn a preset automation on

POST /organizations/{organizationId}/automations/presets/{presetKey}

Customer-facing: creates the preset's message templates and automation (once) and turns it on; from then on matching events, timers and schedules message customers (in test mode they are only logged). Calling it again turns the existing automation back on, keeping edits. Get preset keys from GET /automations/presets.

Permissionengagement.manage (Owner, Admin)
Risksensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolautomations_enablePreset (toolset marketing)
PlanAutomated reminders and follow-ups: the Connect plan and up.
ApprovalOver MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals.

Parameters

NameInTypeRequiredDescription
presetKeypathenumYesFrom GET /automations/presets. One of request_received, quote_follow_up, invoice_sent, invoice_overdue, win_back, referral_reward, payment_receipt, order_shipped, review_request.

Example

curl -X POST "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations/presets/{presetKey}" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
idstring
namestring
descriptionstring or null
presetKeystring or null
enabledboolean
purposeenumOne of TRANSACTIONAL, MARKETING.
timeCriticalboolean
triggerTypeenumOne of EVENT, SCHEDULE, ABSENCE, RELATIVE.
triggerobjectThe trigger (packages/engagement/schemas.ts TriggerSchema).
audienceobject{ conditionTree? }
actionobjectRecipient, first message, follow-ups, exit events.
frequencyCapHoursinteger or null
lastRunAtstring or nullISO 8601 time (UTC).
nextRunAtstring or nullISO 8601 time (UTC).
executionCountinteger
createdAtstringISO 8601 time (UTC).
updatedAtstringISO 8601 time (UTC).
problemstring or nullWhy the stored settings cannot run, if they cannot.

Get an automation

GET /organizations/{organizationId}/automations/{ruleId}

One automation with its trigger, conditions, messages and guardrails. Read-only.

Permissionengagement.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolautomations_get (toolset marketing)

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesAn automation id, from GET /automations.

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations/{ruleId}" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
idstring
namestring
descriptionstring or null
presetKeystring or null
enabledboolean
purposeenumOne of TRANSACTIONAL, MARKETING.
timeCriticalboolean
triggerTypeenumOne of EVENT, SCHEDULE, ABSENCE, RELATIVE.
triggerobjectThe trigger (packages/engagement/schemas.ts TriggerSchema).
audienceobject{ conditionTree? }
actionobjectRecipient, first message, follow-ups, exit events.
frequencyCapHoursinteger or null
lastRunAtstring or nullISO 8601 time (UTC).
nextRunAtstring or nullISO 8601 time (UTC).
executionCountinteger
createdAtstringISO 8601 time (UTC).
updatedAtstringISO 8601 time (UTC).
problemstring or nullWhy the stored settings cannot run, if they cannot.

Edit an automation

PATCH /organizations/{organizationId}/automations/{ruleId}

Customer-facing: replaces the automation's settings (send the whole rule, as GET returns it). Editing a RELATIVE timing re-arms its timers; turning it off withdraws armed timers, open cadences and queued messages.

Permissionengagement.manage (Owner, Admin)
Risksensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolautomations_update (toolset marketing)
ApprovalOver MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals.

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesAn automation id, from GET /automations.

Request body

FieldTypeRequiredDescription
namestringYesUp to 200 characters.
descriptionstring or nullNoUp to 1000 characters.
enabledbooleanNoOn = it starts messaging customers when it fires. Default false.
purposeenumNoMARKETING also needs each customer's marketing consent. One of TRANSACTIONAL, MARKETING. Default TRANSACTIONAL.
timeCriticalbooleanNoSent even in quiet hours (time-critical order messages). Default false.
triggerobjectYesEVENT { eventType }, SCHEDULE { frequency, hourLocal, dayOfWeek }, ABSENCE { eventType, absenceDays, hourLocal } or RELATIVE { anchor, direction, amount, unit, hourLocal } (N minutes/hours/days before or after quote.sent or invoice.due).
audienceobjectNo{ conditionTree }: customer, record, event-history and prediction conditions. Default {}.
audience.conditionTreeobjectNo
audience.conditionTree.kindgroupYes
audience.conditionTree.combinatorenumYesOne of and, or.
audience.conditionTree.notbooleanNo
audience.conditionTree.conditionsarray of objectYesUp to 100 items.
actionobjectYes{ recipient: PRIMARY|BILLING, channel, subject?, body? or messageTemplateId, initialDelayHours?, followUps?: [{ channel, delayHours, … }], exitOnEvents? }
action.recipientenumNoOne of PRIMARY, BILLING. Default PRIMARY.
action.channelenumYesOne of EMAIL, SMS.
action.subjectstringNoUp to 200 characters.
action.bodystringNoUp to 5000 characters.
action.messageTemplateIdstringNo
action.initialDelayHoursintegerNo0–8760.
action.followUpsarray of objectNoUp to 9 items.
action.followUps[].channelenumYesOne of EMAIL, SMS.
action.followUps[].delayHoursintegerYes0–8760.
action.followUps[].subjectstringNoUp to 200 characters.
action.followUps[].bodystringNoUp to 5000 characters.
action.followUps[].messageTemplateIdstringNo
action.exitOnEventsarray of enumNoUp to 10 items.
frequencyCapHoursinteger or nullNoAt most one message of this automation per customer in this many hours. 0–8760.

Example

curl -X PATCH "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations/{ruleId}" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Dana Whitfield","trigger":{"type":"SCHEDULE","frequency":"hourly"},"action":{"channel":"EMAIL"}}'

Response

200: the answer's fields
FieldTypeDescription
idstring
namestring
descriptionstring or null
presetKeystring or null
enabledboolean
purposeenumOne of TRANSACTIONAL, MARKETING.
timeCriticalboolean
triggerTypeenumOne of EVENT, SCHEDULE, ABSENCE, RELATIVE.
triggerobjectThe trigger (packages/engagement/schemas.ts TriggerSchema).
audienceobject{ conditionTree? }
actionobjectRecipient, first message, follow-ups, exit events.
frequencyCapHoursinteger or null
lastRunAtstring or nullISO 8601 time (UTC).
nextRunAtstring or nullISO 8601 time (UTC).
executionCountinteger
createdAtstringISO 8601 time (UTC).
updatedAtstringISO 8601 time (UTC).
problemstring or nullWhy the stored settings cannot run, if they cannot.

Delete an automation

DELETE /organizations/{organizationId}/automations/{ruleId}

Destructive: turns the automation off (withdrawing what it queued) and deletes it with its execution log. Its sent messages stay in the message log. A preset can be turned on again from the gallery.

Permissionengagement.manage (Owner, Admin)
Risksensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolautomations_delete (toolset marketing)
ApprovalOver MCP, this tool always waits for your approval in SKUFlow. See Approvals.

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesAn automation id, from GET /automations.

Example

curl -X DELETE "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations/{ruleId}" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
oktrue

Turn an automation on or off

POST /organizations/{organizationId}/automations/{ruleId}/enabled

Customer-facing: on, it messages customers when it fires (emits automation.enabled); off, its armed timers, open cadences and queued messages are withdrawn (automation.disabled).

Permissionengagement.manage (Owner, Admin)
Risksensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolautomations_setEnabled (toolset marketing)
PlanAutomated reminders and follow-ups: the Connect plan and up.
ApprovalOver MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals.

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesAn automation id, from GET /automations.

Request body

FieldTypeRequiredDescription
enabledbooleanYes

Example

curl -X POST "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations/{ruleId}/enabled" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'

Response

200: the answer's fields
FieldTypeDescription
idstring
namestring
descriptionstring or null
presetKeystring or null
enabledboolean
purposeenumOne of TRANSACTIONAL, MARKETING.
timeCriticalboolean
triggerTypeenumOne of EVENT, SCHEDULE, ABSENCE, RELATIVE.
triggerobjectThe trigger (packages/engagement/schemas.ts TriggerSchema).
audienceobject{ conditionTree? }
actionobjectRecipient, first message, follow-ups, exit events.
frequencyCapHoursinteger or null
lastRunAtstring or nullISO 8601 time (UTC).
nextRunAtstring or nullISO 8601 time (UTC).
executionCountinteger
createdAtstringISO 8601 time (UTC).
updatedAtstringISO 8601 time (UTC).
problemstring or nullWhy the stored settings cannot run, if they cannot.

An automation's execution log

GET /organizations/{organizationId}/automations/{ruleId}/executions

Each time the automation fired (an event, a timer, a schedule slot): for which customer and record, and what came of it (queued, skipped because conditions did not match or the frequency cap). Newest first. Read-only.

Permissionengagement.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolautomations_executions (toolset marketing)

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesAn automation id, from GET /automations.
limitqueryintegerNo1–200. Default 50.

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations/{ruleId}/executions" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields

An array of objects:

FieldTypeDescription
idstring
triggerstringevent:<type> | relative | schedule | absence
statusenumOne of COMPLETED, PARTIAL, FAILED, SKIPPED.
targetedinteger
reachedintegerMessages queued or sent.
customerIdstring or null
subjectTypestring or null
subjectIdstring or null
triggeredByEventIdstring or null
errorstring or null
detailsarray of object
startedAtstringISO 8601 time (UTC).
completedAtstring or nullISO 8601 time (UTC).

An automation's timers (RELATIVE)

GET /organizations/{organizationId}/automations/{ruleId}/timers

For a RELATIVE automation (e.g. 3 days after a quote is sent): the timers armed per record and time, with their state (armed, fired, cancelled because the record changed, skipped because the time had passed). Read-only.

Permissionengagement.read (Owner, Admin, Staff)
Riskread, OAuth scope skuflow.read. Read: reads only.
MCP toolautomations_timers (toolset marketing)

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesAn automation id, from GET /automations.
limitqueryintegerNo1–200. Default 50.

Example

curl "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations/{ruleId}/timers" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY"

Response

200: the answer's fields

An array of objects:

FieldTypeDescription
idstring
customerIdstring
subjectTypestring
subjectIdstring
anchorAtstringThe record's timestamp the offset counts from.
fireAtstringISO 8601 time (UTC).
statusenumOne of ARMED, FIRED, CANCELLED, SKIPPED.
reasonstring or null
firedAtstring or nullISO 8601 time (UTC).

Preview an automation for a customer

POST /organizations/{organizationId}/automations/preview

Renders an automation (saved or not) for a real customer, and optionally one of their records: each condition's outcome (true, false, or unavailable for a prediction that is not computed, such as best send time; predictions come from the customer's own records) and every message as it would be sent, with merge fields filled. Nothing is sent; an invoice link may be made on first use, as the invoice page does. Find customers with GET /customers.

Permissionengagement.read (Owner, Admin, Staff)
Riskwrite, OAuth scope skuflow.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toolautomations_preview (toolset marketing)
PlanAutomated reminders and follow-ups: the Connect plan and up.

Request body

FieldTypeRequiredDescription
ruleobjectYes
rule.namestringYesUp to 200 characters.
rule.descriptionstring or nullNoUp to 1000 characters.
rule.enabledbooleanNoOn = it starts messaging customers when it fires. Default false.
rule.purposeenumNoMARKETING also needs each customer's marketing consent. One of TRANSACTIONAL, MARKETING. Default TRANSACTIONAL.
rule.timeCriticalbooleanNoSent even in quiet hours (time-critical order messages). Default false.
rule.triggerobjectYesEVENT { eventType }, SCHEDULE { frequency, hourLocal, dayOfWeek }, ABSENCE { eventType, absenceDays, hourLocal } or RELATIVE { anchor, direction, amount, unit, hourLocal } (N minutes/hours/days before or after quote.sent or invoice.due).
rule.audienceobjectNo{ conditionTree }: customer, record, event-history and prediction conditions. Default {}.
rule.audience.conditionTreeobjectNo
rule.actionobjectYes{ recipient: PRIMARY|BILLING, channel, subject?, body? or messageTemplateId, initialDelayHours?, followUps?: [{ channel, delayHours, … }], exitOnEvents? }
rule.action.recipientenumNoOne of PRIMARY, BILLING. Default PRIMARY.
rule.action.channelenumYesOne of EMAIL, SMS.
rule.action.subjectstringNoUp to 200 characters.
rule.action.bodystringNoUp to 5000 characters.
rule.action.messageTemplateIdstringNo
rule.action.initialDelayHoursintegerNo0–8760.
rule.action.followUpsarray of objectNoUp to 9 items.
rule.action.exitOnEventsarray of enumNoUp to 10 items.
rule.frequencyCapHoursinteger or nullNoAt most one message of this automation per customer in this many hours. 0–8760.
customerIdstringYesThe sample customer, from GET /customers.
subjectTypeenumNoOne of quote, invoice, payment, request.
subjectIdstringNoA record of that customer to preview with (a quote, an invoice …).

Example

curl -X POST "https://app.skuflow.ai/api/organizations/$ORGANIZATION_ID/automations/preview" \
  -H "Authorization: Bearer $SKUFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rule":{"name":"Dana Whitfield","trigger":{"type":"SCHEDULE","frequency":"hourly"},"action":{"channel":"EMAIL"}},"customerId":"customer_id"}'

Response

200: the answer's fields
FieldTypeDescription
customerobject
customer.idstring
customer.namestring
conditionsobject
conditions.matchesboolean
conditions.leavesarray of object
conditions.leaves[].pathstring
conditions.leaves[].sourcestring
conditions.leaves[].fieldstring
conditions.leaves[].outcomeenumOne of true, false, unavailable, error.
stepsarray of object
steps[].channelenumOne of EMAIL, SMS.
steps[].subjectstring or null
steps[].bodystringThe exact text (SMS) or the email's text part.
steps[].htmlstring or nullThe branded email, as it would be sent.
steps[].unresolvedarray of stringMerge fields with no value for this customer.
steps[].warningsarray of string
steps[].smsobject or null
steps[].sms.charactersinteger
steps[].sms.segmentsinteger
steps[].sms.encodingstring
steps[].indexinteger
steps[].delayHoursinteger

On this page