Skip to content

Check a draft

POST
/v1/automations/check
curl --request POST \
--url https://api.pixonaut.app/v1/automations/check \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "body": { "steps": [ { "id": "order", "settings": { "copies": 1, "shipTo": "customer" }, "type": "place_order" } ] }, "trigger": "print.completed" }'

Operation ID: automations.check

What saving this draft would refuse and warn of, and for each step that acts at a printshop, what it can do at every printshop it can reach: yes, no and why, or only while a rule holds. Nothing is saved.

Media typeapplication/json
object
automationId

The automation this draft saves, when it exists: a member who muted it is warned of as not hearing its notifications, and it is left out of the warning of another automation sending the same.

string
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
string
default: author
Allowed values: author workspace
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

Examples

Exampleexample

Example

{
"body": {
"steps": [
{
"id": "order",
"settings": {
"copies": 1,
"shipTo": "customer"
},
"type": "place_order"
}
]
},
"trigger": "print.completed"
}

The check

Media typeapplication/json
object
refusals
required

What a save of this draft refuses.

Array<object>
object
code
required
string
message
required

What is wrong, in words.

string
stepId

The step it is about.

string
steps
required

Each step that acts at a printshop.

Array<object>
object
printshops
required

Each printshop the step can reach, and what it can do there.

Array
One of:
object
can
required
string
Allowed values: yes
id
required
string
name
required
string
stepId
required
string
type
required
string
warnings
required

What a save allows, and a member should know.

Array<object>
object
code
required
string
message
required

What is wrong, in words.

string
stepId

The step it is about.

string

Examples

Exampleexample

Example

{
"refusals": [],
"steps": [
{
"printshops": [
{
"can": "yes",
"id": "psc_4e8a9f6c1d2e",
"name": "Printful"
},
{
"can": "no",
"id": "psc_7b2c3d4e5f6a",
"name": "Riso Corner",
"reason": "The printshop “Riso Corner” is paused and takes no new orders. Turn Takes orders back on for it, or order from another printshop."
}
],
"stepId": "order",
"type": "place_order"
}
],
"warnings": [
{
"code": "acts_at_some",
"message": "Place an order cannot act at Riso Corner.",
"stepId": "order"
}
]
}
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: 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