Skip to content

Create a workflow

POST
/api/v1/automations/workflows
curl --request POST \
--url https://digize.com/api/v1/automations/workflows \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "id": "example", "name": "example", "description": "example", "nodes": [ { "id": "example", "type": "trigger.form_submitted", "name": "example", "position": { "x": 1, "y": 1 }, "params": { "additionalProperty": { "additionalProperty": {} } }, "disabled": true, "settings": { "onError": "stop", "retries": 1, "notes": "example" } } ], "edges": [ { "id": "example", "source": "example", "sourceHandle": "example", "target": "example" } ] }'

Adds a workflow as a draft, empty or with the nodes and connections given.

Needs the automations:write permission.

Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
id
string
>= 1 characters <= 64 characters
name
required
string
>= 1 characters <= 80 characters
description
string
<= 500 characters
nodes
Array<object>
<= 100 items
object
id
required
string
>= 1 characters <= 64 characters
type
required

The kind of node, such as trigger.form_submitted or action.send_sms.

string
Allowed values: trigger.form_submitted trigger.order_paid trigger.order_refunded trigger.checkout_expired trigger.booking_created trigger.message_received trigger.schedule trigger.webhook action.send_sms action.send_email flow.wait flow.if flow.switch crm.update_contact crm.add_tag crm.create_opportunity app.http_request app.code app.slack_message app.sheets_row
name
required

Unique in the workflow, so expressions can name it: $(‘Wait a day’).

string
<= 60 characters
position
required
object
x
required
number
y
required
number
params
required

The node’s settings, as the catalog defines them.

object
key
additional properties
Any of:
string
disabled
boolean
settings
object
onError
string
Allowed values: stop continue
retries
integer
<= 5
notes
string
<= 2000 characters
edges
Array<object>
<= 300 items
object
id
required
string
>= 1 characters <= 200 characters
source
required
string
>= 1 characters <= 64 characters
sourceHandle
required

Main, or true/false for If, or a path’s id for Switch.

string
>= 1 characters <= 64 characters
target
required
string
>= 1 characters <= 64 characters

Done

Media typeapplication/json
object
id
required
string
name
required
string
description
required
string
status
required

Active runs on its trigger; paused holds waiting runs; draft never runs.

string
Allowed values: active paused draft
nodes
required
Array<object>
<= 100 items
object
id
required
string
>= 1 characters <= 64 characters
type
required

The kind of node, such as trigger.form_submitted or action.send_sms.

string
Allowed values: trigger.form_submitted trigger.order_paid trigger.order_refunded trigger.checkout_expired trigger.booking_created trigger.message_received trigger.schedule trigger.webhook action.send_sms action.send_email flow.wait flow.if flow.switch crm.update_contact crm.add_tag crm.create_opportunity app.http_request app.code app.slack_message app.sheets_row
name
required

Unique in the workflow, so expressions can name it: $(‘Wait a day’).

string
<= 60 characters
position
required
object
x
required
number
y
required
number
params
required

The node’s settings, as the catalog defines them.

object
key
additional properties
Any of:
string
disabled
boolean
settings
object
onError
string
Allowed values: stop continue
retries
integer
<= 5
notes
string
<= 2000 characters
edges
required
Array<object>
<= 300 items
object
id
required
string
>= 1 characters <= 200 characters
source
required
string
>= 1 characters <= 64 characters
sourceHandle
required

Main, or true/false for If, or a path’s id for Switch.

string
>= 1 characters <= 64 characters
target
required
string
>= 1 characters <= 64 characters
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
stats
required
object
runs
required

Runs in the last 30 days, tests left out.

number
completed
required
number
failed
required
number
lastRunAt
required
Any of:
string format: date-time

Example

{
"status": "active",
"nodes": [
{
"type": "trigger.form_submitted",
"settings": {
"onError": "stop"
}
}
]
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}