Save workflow as template
curl --request POST \
--url https://api.kadoa.com/v4/templates/from-workflow \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"includeParts": []
}
'import requests
url = "https://api.kadoa.com/v4/templates/from-workflow"
payload = {
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"includeParts": []
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workflowId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
includeParts: []
})
};
fetch('https://api.kadoa.com/v4/templates/from-workflow', 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.kadoa.com/v4/templates/from-workflow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workflowId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'includeParts' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kadoa.com/v4/templates/from-workflow"
payload := strings.NewReader("{\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"includeParts\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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.kadoa.com/v4/templates/from-workflow")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"includeParts\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kadoa.com/v4/templates/from-workflow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"includeParts\": []\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"success": true,
"data": {
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"isNew": true
}
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}Templates
Save workflow as template
Create a new template from an existing workflow’s configuration
POST
/
v4
/
templates
/
from-workflow
Save workflow as template
curl --request POST \
--url https://api.kadoa.com/v4/templates/from-workflow \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"includeParts": []
}
'import requests
url = "https://api.kadoa.com/v4/templates/from-workflow"
payload = {
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"includeParts": []
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workflowId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
includeParts: []
})
};
fetch('https://api.kadoa.com/v4/templates/from-workflow', 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.kadoa.com/v4/templates/from-workflow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workflowId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'includeParts' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kadoa.com/v4/templates/from-workflow"
payload := strings.NewReader("{\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"includeParts\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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.kadoa.com/v4/templates/from-workflow")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"includeParts\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kadoa.com/v4/templates/from-workflow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"includeParts\": []\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"success": true,
"data": {
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"isNew": true
}
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}Authorizations
API key for authentication
Body
application/json
Body
Request body for saving a workflow's config as a template (new or existing)
Source workflow ID to extract config from
Name for the new template (required if templateId is not set)
Required string length:
1 - 255Description for the new template
Maximum string length:
2000Existing template ID to add a new version to (mutually exclusive with name)
Which workflow parts to include in the template. If omitted, all parts are included.
Minimum array length:
1Available options:
prompt, schema, schemaValidationRules, notifications, frequency ⌘I