Skip to content

Update a workflow draft

PUT
/v1/forms/{form}/workflow/draft
curl --request PUT \
--url https://api.submeto.com/v1/forms/example/workflow/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "definition": {} }'

Replaces the draft definition under optimistic concurrency. Requires workflows:write and the Workflow validator from the latest read.

form
required
string

The form ID.

If-Match
string
Media typeapplication/json
object
definition
required

Complete workflow definition.

object
Examplegenerated
{
"definition": {}
}

Draft updated

Media typeapplication/json
object
data
object
id
string
form_id
string
mode
string
simple_editable
boolean
draft
object
revision
integer
definition
object
schema_version
integer
nodes
array
edges
array
is_dirty
boolean
request_id
string
Example
{
"data": {
"id": "01JWORKFLOW0000000000000000",
"form_id": "REQUEST_ID",
"mode": "advanced",
"simple_editable": false,
"draft": {
"revision": 2,
"definition": {
"schema_version": 1,
"nodes": [],
"edges": []
},
"is_dirty": true
}
},
"request_id": "REQUEST_ID"
}

Stale ETag

Media typeapplication/json
object
error
object
code
string
message
string
details
object
request_id
string
Example
{
"error": {
"code": "precondition_failed",
"message": "The Workflow revision does not match the If-Match ETag.",
"details": {}
},
"request_id": "REQUEST_ID"
}