Restore Workflow Version
curl --request POST \
--url https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "Untitled Workflow",
"description": "",
"project_id": "<string>",
"published": {
"version_id": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"description": ""
},
"capabilities": [
"workflow:view"
],
"authz_status": "provisioning"
}{
"detail": []
}Versions
Restore Workflow Version
POST
/
v1
/
workflows
/
versions
/
{workflow_version_id}
/
restore
Restore Workflow Version
curl --request POST \
--url https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retab.com/v1/workflows/versions/{workflow_version_id}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "Untitled Workflow",
"description": "",
"project_id": "<string>",
"published": {
"version_id": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"description": ""
},
"capabilities": [
"workflow:view"
],
"authz_status": "provisioning"
}{
"detail": []
}Restore a workflow graph version into a new workflow draft.
Python
workflow_version_id = "wfv_abc123"
print(workflow_version_id)
TypeScript
const workflowVersionId = "wfv_abc123";
console.log(workflowVersionId);
Go
workflowVersionID := "wfv_abc123"
_ = workflowVersionID
Java
String workflowVersionId = "wfv_abc123";
System.out.println(workflowVersionId);
cURL
curl -X POST "https://api.retab.com/v1/workflows/versions/wfv_abc123/restore?workflow_id=wf_abc123" \
-H "Authorization: Bearer $RETAB_API_KEY"
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Workflow to restore into a new draft
Response
Successful Response
A workflow and its current configuration.
Unique ID for this workflow
The name of the workflow
Description of the workflow
Project that owns this workflow. Null only on legacy rows that predate the project backfill.
Published workflow metadata when a published version exists
Show child attributes
Show child attributes
Server-derived permissions for the current actor.
Available options:
workflow:view, workflow:edit, workflow:run, workflow:delete, workflow:publish, workflow:review, workflow:manage Provisioning state of this workflow's WorkOS authorization resource.
Available options:
provisioning, ready, failed, deleting, deleted