Skip to content

Find events to test an automation on

POST
/v1/automations/test-run/events
curl --request POST \
--url https://api.pixonaut.app/v1/automations/test-run/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "draft": { "body": { "steps": [ { "id": "print", "settings": {}, "type": "create_print" } ] }, "runsAs": "author", "sources": { "includeNewKeys": true, "includeNewLinks": true, "includeNewStores": true, "keys": null, "links": null, "stores": null }, "spendLimit": 50, "trigger": "design.committed" } }'

Operation ID: automations.testRunEvents

The newest 20 events of its trigger in its sources, or one older one by its id. Nothing is run.

Media typeapplication/json
object
automationId

A saved automation, by its id. Name it or draft.

string
draft

A draft, as the editor holds it. Name it or automationId.

object
body
required

The automation’s tree of steps.

object
conditions
Any of:
object
all
required

Every one holds.

Array
>= 1 items
steps
required

The steps, in the order they run. A step’s type names an action from the catalogue.

Array<object>
object
branches

Further steps, under each branch’s name.

object
key
additional properties
Array
id
required

Its id, unique in the body: what a firing names it by.

string
>= 1 characters <= 64 characters
settings

What its type takes; the draft check refuses settings the type does not.

object
key
additional properties
type
required

Its action (approve, create_print, place_order, reroute, cancel_order, notify, email, webhook) or flow step (only_if, paths, wait_for, delay).

string
>= 1 characters <= 64 characters
runsAs

author: it acts with the grants of the member who last saved it. workspace: it acts as the workspace, tied to no member; only an admin may set it, and an automation made with a secret key always runs so.

string
default: author
Allowed values: author workspace
sources

The sources it acts on: the studio always; designer links, keys and connected stores, each every one or a snapshot. To act on only some, an Only if compares the design’s origin.

object
includeNewKeys
required

On, it acts on designs from every secret and publishable key no store was given, those added later too. Off, only from those in keys.

boolean
includeNewLinks
required

On, it acts on designs from every designer link, those made later too. Off, only from the links in links.

boolean
includeNewStores
required

On, it acts on designs from every connected store, those connected later too. Off, only from those in stores. A store may have its own automated flows on its designs; if it does, the first to move one on wins.

boolean
keys

While its switch is off, those that existed when it was switched off; null while it is on. A save that turns it off with none takes it then.

object
sources
required

Each one that existed then, as a design’s origin names it: link:<id>, secret_key:<id> and publishable_key:<id>, or store:<site>.

Array<string>
<= 10000 items
takenAt
required

When its switch was turned off: the snapshot is as of then.

integer
links

While its switch is off, those that existed when it was switched off; null while it is on. A save that turns it off with none takes it then.

object
sources
required

Each one that existed then, as a design’s origin names it: link:<id>, secret_key:<id> and publishable_key:<id>, or store:<site>.

Array<string>
<= 10000 items
takenAt
required

When its switch was turned off: the snapshot is as of then.

integer
stores

While its switch is off, those that existed when it was switched off; null while it is on. A save that turns it off with none takes it then.

object
sources
required

Each one that existed then, as a design’s origin names it: link:<id>, secret_key:<id> and publishable_key:<id>, or store:<site>.

Array<string>
<= 10000 items
takenAt
required

When its switch was turned off: the snapshot is as of then.

integer
spendLimit

Spend actions it may take per rolling 24 hours.

integer
default: 50 >= 1 <= 10000
trigger
required

The event it fires on; null for none yet, which fires on nothing. One with none cannot be enabled.

string | null
Allowed values: design.committed design.approved design.changes_requested design.delivery_captured print.completed print.failed order.submitted order.status_changed order.failed order.cancelled order.delivery_changed
eventId

One event by its id, among older ones than the newest 20.

string

Examples

Exampleexample

Example

{
"draft": {
"body": {
"steps": [
{
"id": "print",
"settings": {},
"type": "create_print"
}
]
},
"runsAs": "author",
"sources": {
"includeNewKeys": true,
"includeNewLinks": true,
"includeNewStores": true,
"keys": null,
"links": null,
"stores": null
},
"spendLimit": 50,
"trigger": "design.committed"
}
}

The events, newest first

Media typeapplication/json
object
events
required
Array<object>
object
at
required
number
id
required
string
subject
required
object
designId
string
orderId
string
printId
string
revision
number
type
required
string

Examples

Exampleexample

Example

{
"events": [
{
"at": 1760000300000,
"id": "evt_5a1c9e7b2d4f",
"subject": {
"designId": "des_2b4d8a9f6c1e",
"revision": 2
},
"type": "design.committed"
},
{
"at": 1760000100000,
"id": "evt_8c2e4a6b1d3f",
"subject": {
"designId": "des_7f3a2c9e1b4d",
"revision": 1
},
"type": "design.committed"
}
]
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: invalid_body

Media typeapplication/json
object
error
required
string
fields

Always sent with invalid_body.

Array<string>

Examples

Exampleinvalid_body

invalid_body

{
"error": "invalid_body",
"fields": [
"string"
]
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: unauthorized

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: feature_disabled, origin_forbidden, forbidden

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: automation_not_found

Media typeapplication/json
object
error
required
string

Examples

Exampleautomation_not_found

automation_not_found

{
"error": "automation_not_found"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: payload_too_large

Media typeapplication/json
object
bytes
number
error
required
string
maxBytes

Always sent with payload_too_large.

number

Examples

Examplepayload_too_large

payload_too_large

{
"error": "payload_too_large",
"maxBytes": 0
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: db_error. A request that failed unexpectedly answers as text instead.

object
error
required
string

Examples

Exampledb_error

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Questions? Write to [email protected].

Status · Terms of service · Privacy policy · Subprocessors