API reference · Automations
List the automation presets
https://api.pidgely.com/automations/presetsEvery plan. The presets (group saas first, then store) with their default steps, goal, trigger options and settings, and whether the organization can run them (available; automations are on Scale and custom plans). requires_store presets need a connected store. See Automations.
The presets, SaaS first (onboarding, trial ending, failed payment, re-engagement, abandoned checkout; no store needed) then the store ones (abandoned cart, unpaid Pix/boleto, post-purchase, win-back), with their default steps, trigger options, goal and settings, and whether the organization's plan runs automations. Every plan (the dashboard shows the gallery locked below Scale).
Authorization: Bearer pdg_…. An API key with full_access. A sending_access key gets 401 restricted_api_key.
Request
This endpoint is not in the SDKs yet; call it over HTTP.
curl -X GET 'https://api.pidgely.com/automations/presets' \
-H "Authorization: Bearer $PIDGELY_API_KEY"Response
200 OK
{
"available": true,
"required_plan": "scale",
"data": [
{
"preset": "dunning",
"group": "saas",
"requires_store": false,
"goal": {
"event_name": "payment_succeeded",
"value_property": "amount"
},
"exit_events": [],
"filter": {
"segment_id": null,
"properties": []
},
"trigger": "event",
"trigger_options": {
"event_name": "payment_failed"
},
"settings": {
"quiet_hours": {
"enabled": true,
"start": 22,
"end": 8
},
"frequency_cap": true,
"attribution_days": 7,
"from": "",
"currency": ""
},
"steps": [
{
"id": "00000000-0000-0000-0000-000000000000",
"position": 0,
"kind": "email",
"wait_seconds": 0,
"template_id": null,
"template_name": "Failed payment · 1",
"template_subject": "We couldn't process your payment",
"subject": "",
"from": "",
"coupon_code": "",
"event_name": "",
"on_event": "",
"on_timeout": ""
},
{
"id": "00000000-0000-0000-0000-000000000000",
"position": 1,
"kind": "wait",
"wait_seconds": 259200,
"template_id": null,
"template_name": "",
"template_subject": "",
"subject": "",
"from": "",
"coupon_code": "",
"event_name": "",
"on_event": "",
"on_timeout": ""
},
{
"id": "00000000-0000-0000-0000-000000000000",
"position": 2,
"kind": "email",
"wait_seconds": 0,
"template_id": null,
"template_name": "Failed payment · 2",
"template_subject": "Your payment is still pending",
"subject": "",
"from": "",
"coupon_code": "",
"event_name": "",
"on_event": "",
"on_timeout": ""
}
]
},
{
"preset": "payment_pending",
"group": "store",
"requires_store": true,
"goal": {
"event_name": "",
"value_property": ""
},
"exit_events": [],
"filter": {
"segment_id": null,
"properties": []
},
"trigger": "payment_pending",
"trigger_options": {
"methods": [
"pix",
"boleto"
]
},
"settings": {
"quiet_hours": {
"enabled": true,
"start": 22,
"end": 8
},
"frequency_cap": true,
"attribution_days": 7,
"from": "",
"currency": ""
},
"steps": [
{
"id": "00000000-0000-0000-0000-000000000000",
"position": 0,
"kind": "wait",
"wait_seconds": 1800,
"template_id": null,
"template_name": "",
"template_subject": "",
"subject": "",
"from": "",
"coupon_code": "",
"event_name": "",
"on_event": "",
"on_timeout": ""
},
{
"id": "00000000-0000-0000-0000-000000000000",
"position": 1,
"kind": "email",
"wait_seconds": 0,
"template_id": null,
"template_name": "Unpaid Pix/boleto · 1",
"template_subject": "Your order #{{{ORDER_NUMBER}}} is waiting for payment",
"subject": "",
"from": "",
"coupon_code": "",
"event_name": "",
"on_event": "",
"on_timeout": ""
},
{
"id": "00000000-0000-0000-0000-000000000000",
"position": 2,
"kind": "wait",
"wait_seconds": 86400,
"template_id": null,
"template_name": "",
"template_subject": "",
"subject": "",
"from": "",
"coupon_code": "",
"event_name": "",
"on_event": "",
"on_timeout": ""
},
{
"id": "00000000-0000-0000-0000-000000000000",
"position": 3,
"kind": "email",
"wait_seconds": 0,
"template_id": null,
"template_name": "Unpaid Pix/boleto · 2",
"template_subject": "Don't lose your order #{{{ORDER_NUMBER}}}",
"subject": "",
"from": "",
"coupon_code": "",
"event_name": "",
"on_event": "",
"on_timeout": ""
}
]
}
]
}Response fields
| Name | Type | Required | Description |
|---|---|---|---|
available |
boolean | Yes | The organization's plan runs automations. |
required_plan |
string | Yes | — |
data |
object[] | Yes | Items of this page. |
data[].preset |
string | Yes | — |
data[].group |
string | Yes | One of saas, store. |
data[].requires_store |
boolean | Yes | — |
data[].goal |
object | Yes | The event that ends the enrollment as a success (exit reason goal). It counts as a conversion when an e-mail of the automation went out within the attribution window; value_property (major units, e.g. 49.90) is summed as revenue. |
data[].goal.event_name |
string | Yes | Empty = no goal event (store automations use their orders and payments). |
data[].goal.value_property |
string | Yes | — |
data[].exit_events |
string[] | Yes | — |
data[].filter |
object | Yes | Entry filter. Only contacts in segment_id (when set) whose properties match every condition enter. |
data[].filter.segment_id |
string | null | Yes | Segment the broadcast is sent to. UUID. |
data[].filter.properties |
object[] | Yes | Custom properties: up to 100 keys matching ^[A-Za-z_][A-Za-z0-9_]{0,49}$, values string (up to 2,000 characters), number, boolean, or null to delete. |
data[].filter.properties[].key |
string | Yes | — |
data[].filter.properties[].op |
string | Yes | One of eq, neq, exists, not_exists. |
data[].filter.properties[].value |
string | No | Compared as text (numbers and booleans as written in JSON). |
data[].trigger |
string | Yes | One of cart_abandoned, payment_pending, post_purchase, winback, event, contact_added, contact_date, inactivity. |
data[].steps |
object[] | Yes | — |
data[].steps[].id |
string | Yes | Unique id (UUID). UUID. |
data[].steps[].position |
integer | Yes | — |
data[].steps[].kind |
string | Yes | One of wait, email, wait_event. |
data[].steps[].wait_seconds |
integer | Yes | wait: duration. |
data[].steps[].template_id |
string | null | Yes | email: builder template (edit it in the template builder). UUID. |
data[].steps[].template_name |
string | Yes | — |
data[].steps[].template_subject |
string | Yes | The template's subject in the store's language. |
data[].steps[].subject |
string | Yes | Subject override; empty = the template's (per language). |
data[].steps[].from |
string | Yes | Sender; empty = the store's sender address. |
data[].steps[].coupon_code |
string | Yes | {{{COUPON_CODE}}}; empty = blocks mentioning the coupon are left out. |
data[].steps[].event_name |
string | Yes | wait_event: the event waited for (up to wait_seconds). |
data[].steps[].on_event |
string | Yes | wait_event: go on (continue) or end the enrollment (exit, reason event_received) when the event happens. One of ``, continue, exit. |
data[].steps[].on_timeout |
string | Yes | wait_event: go on or end the enrollment (reason timeout) when the wait runs out. One of ``, continue, exit. |
data[].trigger_options |
object | Yes | methods (payment_pending: pix, boleto), delivery_fallback_days (post_purchase: an order paid this many days ago without a delivery event counts as delivered, 1-60), inactive_days (winback: days since the last paid order, 14-730; inactivity: days without the event, 1-365), event_name (event, inactivity), segment_id and sources (contact_added), property, offset_seconds, send_hour and yearly (contact_date). |
data[].trigger_options.methods |
string[] | No | — |
data[].trigger_options.delivery_fallback_days |
integer | No | — |
data[].trigger_options.inactive_days |
integer | No | winback: 14-730; inactivity: 1-365. |
data[].trigger_options.event_name |
string | No | event: the event that enrolls; inactivity: the event whose absence counts (empty = any event). |
data[].trigger_options.segment_id |
string | null | No | contact_added: only contacts added to this segment (null = every new contact). UUID. |
data[].trigger_options.sources |
string[] | No | contact_added: sources of new contacts that count (empty = any). |
data[].trigger_options.property |
string | No | contact_date: contact property holding the date (YYYY-MM-DD or RFC 3339). |
data[].trigger_options.offset_seconds |
integer | No | contact_date: signed offset from the date (-259200 = 3 days before). |
data[].trigger_options.send_hour |
integer | No | contact_date: hour of the day for dates without a time, in the automation's time zone (default 9). Between 0 and 23. |
data[].trigger_options.yearly |
boolean | No | contact_date: every year on the date (birthdays). |
data[].settings |
object | Yes | Optional behaviours. Quiet hours hold e-mails between start and end o'clock in the store's time zone (from its currency; timezone overrides it) and send them at end. The frequency cap allows one automation e-mail per address per 24 hours across every automation of the organization (later ones wait). Orders placed up to attribution_days after an automation e-mail count as recovered revenue. |
data[].settings.quiet_hours |
object | Yes | — |
data[].settings.quiet_hours.enabled |
boolean | Yes | — |
data[].settings.quiet_hours.start |
integer | Yes | Between 0 and 23. |
data[].settings.quiet_hours.end |
integer | Yes | Between 0 and 23. |
data[].settings.quiet_hours.timezone |
string | No | IANA time zone; empty = the store's (organization automations default to America/Sao_Paulo). |
data[].settings.frequency_cap |
boolean | Yes | — |
data[].settings.attribution_days |
integer | Yes | Between 1 and 30. |
data[].settings.from |
string | No | Default sender of an organization automation's e-mails (a step's sender wins; empty = the template's). |
data[].settings.currency |
string | No | ISO 4217 currency of an organization automation's revenue (default BRL). |
Errors
Errors have the shape {"statusCode", "name", "message"}. See Errors for the full list.
| Status | Name | When |
|---|---|---|
| 401 | missing_api_key, restricted_api_key |
No Authorization: Bearer header, or a sending_access key called an endpoint that needs full_access. |
| 429 | rate_limit_exceeded |
Too many requests per second. Wait for Retry-After seconds. |