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.
| Operation | Endpoint | Risk |
|---|---|---|
| List automations | GET /organizations/{organizationId}/automations | read |
| Create an automation | POST /organizations/{organizationId}/automations | sensitive |
| List the automation presets (template gallery) | GET /organizations/{organizationId}/automations/presets | read |
| Turn a preset automation on | POST /organizations/{organizationId}/automations/presets/{presetKey} | sensitive |
| Get an automation | GET /organizations/{organizationId}/automations/{ruleId} | read |
| Edit an automation | PATCH /organizations/{organizationId}/automations/{ruleId} | sensitive |
| Delete an automation | DELETE /organizations/{organizationId}/automations/{ruleId} | sensitive |
| Turn an automation on or off | POST /organizations/{organizationId}/automations/{ruleId}/enabled | sensitive |
| An automation's execution log | GET /organizations/{organizationId}/automations/{ruleId}/executions | read |
| An automation's timers (RELATIVE) | GET /organizations/{organizationId}/automations/{ruleId}/timers | read |
| Preview an automation for a customer | POST /organizations/{organizationId}/automations/preview | write |
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.
| Permission | engagement.read (Owner, Admin, Staff) |
| Risk | read, OAuth scope skuflow.read. Read: reads only. |
| MCP tool | automations_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:
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | |
description | string or null | |
presetKey | string or null | |
enabled | boolean | |
purpose | enum | One of TRANSACTIONAL, MARKETING. |
timeCritical | boolean | |
triggerType | enum | One of EVENT, SCHEDULE, ABSENCE, RELATIVE. |
trigger | object | The trigger (packages/engagement/schemas.ts TriggerSchema). |
audience | object | { conditionTree? } |
action | object | Recipient, first message, follow-ups, exit events. |
frequencyCapHours | integer or null | |
lastRunAt | string or null | ISO 8601 time (UTC). |
nextRunAt | string or null | ISO 8601 time (UTC). |
executionCount | integer | |
createdAt | string | ISO 8601 time (UTC). |
updatedAt | string | ISO 8601 time (UTC). |
problem | string or null | Why the stored settings cannot run, if they cannot. |
stats | object | |
stats.sent | integer | Sent, sent in test mode, or delivered. |
stats.delivered | integer | |
stats.failed | integer | Failed or bounced. |
stats.deferred | integer | Waiting for quiet hours to end. |
stats.skipped | integer | Not sent: consent, caps, missing address or link. |
stats.queued | integer |
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.
| Permission | engagement.manage (Owner, Admin) |
| Risk | sensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access. |
| MCP tool | automations_create (toolset marketing) |
| Plan | Automated reminders and follow-ups: the Connect plan and up. |
| Approval | Over MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Up to 200 characters. |
description | string or null | No | Up to 1000 characters. |
enabled | boolean | No | On = it starts messaging customers when it fires. Default false. |
purpose | enum | No | MARKETING also needs each customer's marketing consent. One of TRANSACTIONAL, MARKETING. Default TRANSACTIONAL. |
timeCritical | boolean | No | Sent even in quiet hours (time-critical order messages). Default false. |
trigger | object | Yes | EVENT { 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). |
audience | object | No | { conditionTree }: customer, record, event-history and prediction conditions. Default {}. |
audience.conditionTree | object | No | |
audience.conditionTree.kind | group | Yes | |
audience.conditionTree.combinator | enum | Yes | One of and, or. |
audience.conditionTree.not | boolean | No | |
audience.conditionTree.conditions | array of object | Yes | Up to 100 items. |
action | object | Yes | { recipient: PRIMARY|BILLING, channel, subject?, body? or messageTemplateId, initialDelayHours?, followUps?: [{ channel, delayHours, … }], exitOnEvents? } |
action.recipient | enum | No | One of PRIMARY, BILLING. Default PRIMARY. |
action.channel | enum | Yes | One of EMAIL, SMS. |
action.subject | string | No | Up to 200 characters. |
action.body | string | No | Up to 5000 characters. |
action.messageTemplateId | string | No | |
action.initialDelayHours | integer | No | 0–8760. |
action.followUps | array of object | No | Up to 9 items. |
action.followUps[].channel | enum | Yes | One of EMAIL, SMS. |
action.followUps[].delayHours | integer | Yes | 0–8760. |
action.followUps[].subject | string | No | Up to 200 characters. |
action.followUps[].body | string | No | Up to 5000 characters. |
action.followUps[].messageTemplateId | string | No | |
action.exitOnEvents | array of enum | No | Up to 10 items. |
frequencyCapHours | integer or null | No | At 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
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | |
description | string or null | |
presetKey | string or null | |
enabled | boolean | |
purpose | enum | One of TRANSACTIONAL, MARKETING. |
timeCritical | boolean | |
triggerType | enum | One of EVENT, SCHEDULE, ABSENCE, RELATIVE. |
trigger | object | The trigger (packages/engagement/schemas.ts TriggerSchema). |
audience | object | { conditionTree? } |
action | object | Recipient, first message, follow-ups, exit events. |
frequencyCapHours | integer or null | |
lastRunAt | string or null | ISO 8601 time (UTC). |
nextRunAt | string or null | ISO 8601 time (UTC). |
executionCount | integer | |
createdAt | string | ISO 8601 time (UTC). |
updatedAt | string | ISO 8601 time (UTC). |
problem | string or null | Why 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.
| Permission | engagement.read (Owner, Admin, Staff) |
| Risk | read, OAuth scope skuflow.read. Read: reads only. |
| MCP tool | automations_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:
| Field | Type | Description |
|---|---|---|
key | string | |
name | string | |
description | string | |
when | string | What fires it, in words. |
purpose | enum | One of TRANSACTIONAL, MARKETING. |
timeCritical | boolean | |
channels | array of enum | |
steps | integer | |
needs | array of string | Setup still missing (e.g. a review link). |
ruleId | string or null | The automation made from it, when there is one. |
enabled | boolean |
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.
| Permission | engagement.manage (Owner, Admin) |
| Risk | sensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access. |
| MCP tool | automations_enablePreset (toolset marketing) |
| Plan | Automated reminders and follow-ups: the Connect plan and up. |
| Approval | Over MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals. |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
presetKey | path | enum | Yes | From 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
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | |
description | string or null | |
presetKey | string or null | |
enabled | boolean | |
purpose | enum | One of TRANSACTIONAL, MARKETING. |
timeCritical | boolean | |
triggerType | enum | One of EVENT, SCHEDULE, ABSENCE, RELATIVE. |
trigger | object | The trigger (packages/engagement/schemas.ts TriggerSchema). |
audience | object | { conditionTree? } |
action | object | Recipient, first message, follow-ups, exit events. |
frequencyCapHours | integer or null | |
lastRunAt | string or null | ISO 8601 time (UTC). |
nextRunAt | string or null | ISO 8601 time (UTC). |
executionCount | integer | |
createdAt | string | ISO 8601 time (UTC). |
updatedAt | string | ISO 8601 time (UTC). |
problem | string or null | Why 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.
| Permission | engagement.read (Owner, Admin, Staff) |
| Risk | read, OAuth scope skuflow.read. Read: reads only. |
| MCP tool | automations_get (toolset marketing) |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
ruleId | path | string | Yes | An 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
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | |
description | string or null | |
presetKey | string or null | |
enabled | boolean | |
purpose | enum | One of TRANSACTIONAL, MARKETING. |
timeCritical | boolean | |
triggerType | enum | One of EVENT, SCHEDULE, ABSENCE, RELATIVE. |
trigger | object | The trigger (packages/engagement/schemas.ts TriggerSchema). |
audience | object | { conditionTree? } |
action | object | Recipient, first message, follow-ups, exit events. |
frequencyCapHours | integer or null | |
lastRunAt | string or null | ISO 8601 time (UTC). |
nextRunAt | string or null | ISO 8601 time (UTC). |
executionCount | integer | |
createdAt | string | ISO 8601 time (UTC). |
updatedAt | string | ISO 8601 time (UTC). |
problem | string or null | Why 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.
| Permission | engagement.manage (Owner, Admin) |
| Risk | sensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access. |
| MCP tool | automations_update (toolset marketing) |
| Approval | Over MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals. |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
ruleId | path | string | Yes | An automation id, from GET /automations. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Up to 200 characters. |
description | string or null | No | Up to 1000 characters. |
enabled | boolean | No | On = it starts messaging customers when it fires. Default false. |
purpose | enum | No | MARKETING also needs each customer's marketing consent. One of TRANSACTIONAL, MARKETING. Default TRANSACTIONAL. |
timeCritical | boolean | No | Sent even in quiet hours (time-critical order messages). Default false. |
trigger | object | Yes | EVENT { 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). |
audience | object | No | { conditionTree }: customer, record, event-history and prediction conditions. Default {}. |
audience.conditionTree | object | No | |
audience.conditionTree.kind | group | Yes | |
audience.conditionTree.combinator | enum | Yes | One of and, or. |
audience.conditionTree.not | boolean | No | |
audience.conditionTree.conditions | array of object | Yes | Up to 100 items. |
action | object | Yes | { recipient: PRIMARY|BILLING, channel, subject?, body? or messageTemplateId, initialDelayHours?, followUps?: [{ channel, delayHours, … }], exitOnEvents? } |
action.recipient | enum | No | One of PRIMARY, BILLING. Default PRIMARY. |
action.channel | enum | Yes | One of EMAIL, SMS. |
action.subject | string | No | Up to 200 characters. |
action.body | string | No | Up to 5000 characters. |
action.messageTemplateId | string | No | |
action.initialDelayHours | integer | No | 0–8760. |
action.followUps | array of object | No | Up to 9 items. |
action.followUps[].channel | enum | Yes | One of EMAIL, SMS. |
action.followUps[].delayHours | integer | Yes | 0–8760. |
action.followUps[].subject | string | No | Up to 200 characters. |
action.followUps[].body | string | No | Up to 5000 characters. |
action.followUps[].messageTemplateId | string | No | |
action.exitOnEvents | array of enum | No | Up to 10 items. |
frequencyCapHours | integer or null | No | At 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
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | |
description | string or null | |
presetKey | string or null | |
enabled | boolean | |
purpose | enum | One of TRANSACTIONAL, MARKETING. |
timeCritical | boolean | |
triggerType | enum | One of EVENT, SCHEDULE, ABSENCE, RELATIVE. |
trigger | object | The trigger (packages/engagement/schemas.ts TriggerSchema). |
audience | object | { conditionTree? } |
action | object | Recipient, first message, follow-ups, exit events. |
frequencyCapHours | integer or null | |
lastRunAt | string or null | ISO 8601 time (UTC). |
nextRunAt | string or null | ISO 8601 time (UTC). |
executionCount | integer | |
createdAt | string | ISO 8601 time (UTC). |
updatedAt | string | ISO 8601 time (UTC). |
problem | string or null | Why 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.
| Permission | engagement.manage (Owner, Admin) |
| Risk | sensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access. |
| MCP tool | automations_delete (toolset marketing) |
| Approval | Over MCP, this tool always waits for your approval in SKUFlow. See Approvals. |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
ruleId | path | string | Yes | An 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
| Field | Type | Description |
|---|---|---|
ok | true |
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).
| Permission | engagement.manage (Owner, Admin) |
| Risk | sensitive, OAuth scope skuflow.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access. |
| MCP tool | automations_setEnabled (toolset marketing) |
| Plan | Automated reminders and follow-ups: the Connect plan and up. |
| Approval | Over MCP, this tool asks for your OK first (in the AI app when it supports it, otherwise in SKUFlow). See Approvals. |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
ruleId | path | string | Yes | An automation id, from GET /automations. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes |
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
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | |
description | string or null | |
presetKey | string or null | |
enabled | boolean | |
purpose | enum | One of TRANSACTIONAL, MARKETING. |
timeCritical | boolean | |
triggerType | enum | One of EVENT, SCHEDULE, ABSENCE, RELATIVE. |
trigger | object | The trigger (packages/engagement/schemas.ts TriggerSchema). |
audience | object | { conditionTree? } |
action | object | Recipient, first message, follow-ups, exit events. |
frequencyCapHours | integer or null | |
lastRunAt | string or null | ISO 8601 time (UTC). |
nextRunAt | string or null | ISO 8601 time (UTC). |
executionCount | integer | |
createdAt | string | ISO 8601 time (UTC). |
updatedAt | string | ISO 8601 time (UTC). |
problem | string or null | Why 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.
| Permission | engagement.read (Owner, Admin, Staff) |
| Risk | read, OAuth scope skuflow.read. Read: reads only. |
| MCP tool | automations_executions (toolset marketing) |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
ruleId | path | string | Yes | An automation id, from GET /automations. |
limit | query | integer | No | 1–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:
| Field | Type | Description |
|---|---|---|
id | string | |
trigger | string | event:<type> | relative | schedule | absence |
status | enum | One of COMPLETED, PARTIAL, FAILED, SKIPPED. |
targeted | integer | |
reached | integer | Messages queued or sent. |
customerId | string or null | |
subjectType | string or null | |
subjectId | string or null | |
triggeredByEventId | string or null | |
error | string or null | |
details | array of object | |
startedAt | string | ISO 8601 time (UTC). |
completedAt | string or null | ISO 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.
| Permission | engagement.read (Owner, Admin, Staff) |
| Risk | read, OAuth scope skuflow.read. Read: reads only. |
| MCP tool | automations_timers (toolset marketing) |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
ruleId | path | string | Yes | An automation id, from GET /automations. |
limit | query | integer | No | 1–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:
| Field | Type | Description |
|---|---|---|
id | string | |
customerId | string | |
subjectType | string | |
subjectId | string | |
anchorAt | string | The record's timestamp the offset counts from. |
fireAt | string | ISO 8601 time (UTC). |
status | enum | One of ARMED, FIRED, CANCELLED, SKIPPED. |
reason | string or null | |
firedAt | string or null | ISO 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.
| Permission | engagement.read (Owner, Admin, Staff) |
| Risk | write, OAuth scope skuflow.write. Write: creates or changes records inside the business; nothing leaves it. |
| MCP tool | automations_preview (toolset marketing) |
| Plan | Automated reminders and follow-ups: the Connect plan and up. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
rule | object | Yes | |
rule.name | string | Yes | Up to 200 characters. |
rule.description | string or null | No | Up to 1000 characters. |
rule.enabled | boolean | No | On = it starts messaging customers when it fires. Default false. |
rule.purpose | enum | No | MARKETING also needs each customer's marketing consent. One of TRANSACTIONAL, MARKETING. Default TRANSACTIONAL. |
rule.timeCritical | boolean | No | Sent even in quiet hours (time-critical order messages). Default false. |
rule.trigger | object | Yes | EVENT { 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.audience | object | No | { conditionTree }: customer, record, event-history and prediction conditions. Default {}. |
rule.audience.conditionTree | object | No | |
rule.action | object | Yes | { recipient: PRIMARY|BILLING, channel, subject?, body? or messageTemplateId, initialDelayHours?, followUps?: [{ channel, delayHours, … }], exitOnEvents? } |
rule.action.recipient | enum | No | One of PRIMARY, BILLING. Default PRIMARY. |
rule.action.channel | enum | Yes | One of EMAIL, SMS. |
rule.action.subject | string | No | Up to 200 characters. |
rule.action.body | string | No | Up to 5000 characters. |
rule.action.messageTemplateId | string | No | |
rule.action.initialDelayHours | integer | No | 0–8760. |
rule.action.followUps | array of object | No | Up to 9 items. |
rule.action.exitOnEvents | array of enum | No | Up to 10 items. |
rule.frequencyCapHours | integer or null | No | At most one message of this automation per customer in this many hours. 0–8760. |
customerId | string | Yes | The sample customer, from GET /customers. |
subjectType | enum | No | One of quote, invoice, payment, request. |
subjectId | string | No | A 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
| Field | Type | Description |
|---|---|---|
customer | object | |
customer.id | string | |
customer.name | string | |
conditions | object | |
conditions.matches | boolean | |
conditions.leaves | array of object | |
conditions.leaves[].path | string | |
conditions.leaves[].source | string | |
conditions.leaves[].field | string | |
conditions.leaves[].outcome | enum | One of true, false, unavailable, error. |
steps | array of object | |
steps[].channel | enum | One of EMAIL, SMS. |
steps[].subject | string or null | |
steps[].body | string | The exact text (SMS) or the email's text part. |
steps[].html | string or null | The branded email, as it would be sent. |
steps[].unresolved | array of string | Merge fields with no value for this customer. |
steps[].warnings | array of string | |
steps[].sms | object or null | |
steps[].sms.characters | integer | |
steps[].sms.segments | integer | |
steps[].sms.encoding | string | |
steps[].index | integer | |
steps[].delayHours | integer |