Restore a version to draft
POST
/v1/forms/{form}/workflow/versions/{version}/restore-draft
const url = 'https://api.submeto.com/v1/forms/example/workflow/versions/1/restore-draft';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.submeto.com/v1/forms/example/workflow/versions/1/restore-draft \ --header 'Authorization: Bearer <token>'Copies a historical definition into the draft; it does not repoint the
published version. Requires workflows:write and a current Workflow ETag.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”form
required
string
The form ID.
version
required
integer
The source version number.
Header Parameters
Section titled “Header Parameters”If-Match
string
Responses
Section titled “Responses”Version restored to draft
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
restored_from_version_id
string
request_id
string
Example
{ "data": { "id": "01JWORKFLOW0000000000000000", "form_id": "REQUEST_ID", "mode": "simple", "simple_editable": false, "draft": { "revision": 3, "definition": { "schema_version": 1, "nodes": [], "edges": [] }, "is_dirty": true, "restored_from_version_id": "01JVERSION00000000000000001" } }, "request_id": "REQUEST_ID"}