Update Workflow
curl --request PATCH \
--url https://api.sandbox.usenash.com/v1/workflows/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"nodes": [
{
"nodeKey": "<string>",
"nodeLabel": "<string>",
"nodeActionConfig": {},
"nodeFilterConfig": [
{}
],
"isEnabled": true,
"isTrigger": true
}
],
"edges": [
{
"edgeKey": "<string>",
"sourceNodeKey": "<string>",
"targetNodeKey": "<string>",
"executionOrder": 123
}
],
"trigger": {
"eventTriggerType": "<string>",
"eventName": "<string>",
"customEventDefinitionId": "<string>",
"courierFormDefinitionId": "<string>",
"notificationTriggerParameters": {},
"isEnabled": true
}
}
'import requests
url = "https://api.sandbox.usenash.com/v1/workflows/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"nodes": [
{
"nodeKey": "<string>",
"nodeLabel": "<string>",
"nodeActionConfig": {},
"nodeFilterConfig": [{}],
"isEnabled": True,
"isTrigger": True
}
],
"edges": [
{
"edgeKey": "<string>",
"sourceNodeKey": "<string>",
"targetNodeKey": "<string>",
"executionOrder": 123
}
],
"trigger": {
"eventTriggerType": "<string>",
"eventName": "<string>",
"customEventDefinitionId": "<string>",
"courierFormDefinitionId": "<string>",
"notificationTriggerParameters": {},
"isEnabled": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
nodes: [
{
nodeKey: '<string>',
nodeLabel: '<string>',
nodeActionConfig: {},
nodeFilterConfig: [{}],
isEnabled: true,
isTrigger: true
}
],
edges: [
{
edgeKey: '<string>',
sourceNodeKey: '<string>',
targetNodeKey: '<string>',
executionOrder: 123
}
],
trigger: {
eventTriggerType: '<string>',
eventName: '<string>',
customEventDefinitionId: '<string>',
courierFormDefinitionId: '<string>',
notificationTriggerParameters: {},
isEnabled: true
}
})
};
fetch('https://api.sandbox.usenash.com/v1/workflows/{id}', 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.sandbox.usenash.com/v1/workflows/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'nodes' => [
[
'nodeKey' => '<string>',
'nodeLabel' => '<string>',
'nodeActionConfig' => [
],
'nodeFilterConfig' => [
[
]
],
'isEnabled' => true,
'isTrigger' => true
]
],
'edges' => [
[
'edgeKey' => '<string>',
'sourceNodeKey' => '<string>',
'targetNodeKey' => '<string>',
'executionOrder' => 123
]
],
'trigger' => [
'eventTriggerType' => '<string>',
'eventName' => '<string>',
'customEventDefinitionId' => '<string>',
'courierFormDefinitionId' => '<string>',
'notificationTriggerParameters' => [
],
'isEnabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.sandbox.usenash.com/v1/workflows/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"nodes\": [\n {\n \"nodeKey\": \"<string>\",\n \"nodeLabel\": \"<string>\",\n \"nodeActionConfig\": {},\n \"nodeFilterConfig\": [\n {}\n ],\n \"isEnabled\": true,\n \"isTrigger\": true\n }\n ],\n \"edges\": [\n {\n \"edgeKey\": \"<string>\",\n \"sourceNodeKey\": \"<string>\",\n \"targetNodeKey\": \"<string>\",\n \"executionOrder\": 123\n }\n ],\n \"trigger\": {\n \"eventTriggerType\": \"<string>\",\n \"eventName\": \"<string>\",\n \"customEventDefinitionId\": \"<string>\",\n \"courierFormDefinitionId\": \"<string>\",\n \"notificationTriggerParameters\": {},\n \"isEnabled\": true\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.sandbox.usenash.com/v1/workflows/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"nodes\": [\n {\n \"nodeKey\": \"<string>\",\n \"nodeLabel\": \"<string>\",\n \"nodeActionConfig\": {},\n \"nodeFilterConfig\": [\n {}\n ],\n \"isEnabled\": true,\n \"isTrigger\": true\n }\n ],\n \"edges\": [\n {\n \"edgeKey\": \"<string>\",\n \"sourceNodeKey\": \"<string>\",\n \"targetNodeKey\": \"<string>\",\n \"executionOrder\": 123\n }\n ],\n \"trigger\": {\n \"eventTriggerType\": \"<string>\",\n \"eventName\": \"<string>\",\n \"customEventDefinitionId\": \"<string>\",\n \"courierFormDefinitionId\": \"<string>\",\n \"notificationTriggerParameters\": {},\n \"isEnabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/workflows/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"nodes\": [\n {\n \"nodeKey\": \"<string>\",\n \"nodeLabel\": \"<string>\",\n \"nodeActionConfig\": {},\n \"nodeFilterConfig\": [\n {}\n ],\n \"isEnabled\": true,\n \"isTrigger\": true\n }\n ],\n \"edges\": [\n {\n \"edgeKey\": \"<string>\",\n \"sourceNodeKey\": \"<string>\",\n \"targetNodeKey\": \"<string>\",\n \"executionOrder\": 123\n }\n ],\n \"trigger\": {\n \"eventTriggerType\": \"<string>\",\n \"eventName\": \"<string>\",\n \"customEventDefinitionId\": \"<string>\",\n \"courierFormDefinitionId\": \"<string>\",\n \"notificationTriggerParameters\": {},\n \"isEnabled\": true\n }\n}"
response = http.request(request)
puts response.read_body[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Update Workflow
Update an existing workflow. Only provided fields are updated. If nodes, edges, and trigger are all provided, a new workflow version is created. These three structure fields must be provided together or not at all.
PATCH
/
v1
/
workflows
/
{id}
Update Workflow
curl --request PATCH \
--url https://api.sandbox.usenash.com/v1/workflows/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"nodes": [
{
"nodeKey": "<string>",
"nodeLabel": "<string>",
"nodeActionConfig": {},
"nodeFilterConfig": [
{}
],
"isEnabled": true,
"isTrigger": true
}
],
"edges": [
{
"edgeKey": "<string>",
"sourceNodeKey": "<string>",
"targetNodeKey": "<string>",
"executionOrder": 123
}
],
"trigger": {
"eventTriggerType": "<string>",
"eventName": "<string>",
"customEventDefinitionId": "<string>",
"courierFormDefinitionId": "<string>",
"notificationTriggerParameters": {},
"isEnabled": true
}
}
'import requests
url = "https://api.sandbox.usenash.com/v1/workflows/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"nodes": [
{
"nodeKey": "<string>",
"nodeLabel": "<string>",
"nodeActionConfig": {},
"nodeFilterConfig": [{}],
"isEnabled": True,
"isTrigger": True
}
],
"edges": [
{
"edgeKey": "<string>",
"sourceNodeKey": "<string>",
"targetNodeKey": "<string>",
"executionOrder": 123
}
],
"trigger": {
"eventTriggerType": "<string>",
"eventName": "<string>",
"customEventDefinitionId": "<string>",
"courierFormDefinitionId": "<string>",
"notificationTriggerParameters": {},
"isEnabled": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
nodes: [
{
nodeKey: '<string>',
nodeLabel: '<string>',
nodeActionConfig: {},
nodeFilterConfig: [{}],
isEnabled: true,
isTrigger: true
}
],
edges: [
{
edgeKey: '<string>',
sourceNodeKey: '<string>',
targetNodeKey: '<string>',
executionOrder: 123
}
],
trigger: {
eventTriggerType: '<string>',
eventName: '<string>',
customEventDefinitionId: '<string>',
courierFormDefinitionId: '<string>',
notificationTriggerParameters: {},
isEnabled: true
}
})
};
fetch('https://api.sandbox.usenash.com/v1/workflows/{id}', 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.sandbox.usenash.com/v1/workflows/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'nodes' => [
[
'nodeKey' => '<string>',
'nodeLabel' => '<string>',
'nodeActionConfig' => [
],
'nodeFilterConfig' => [
[
]
],
'isEnabled' => true,
'isTrigger' => true
]
],
'edges' => [
[
'edgeKey' => '<string>',
'sourceNodeKey' => '<string>',
'targetNodeKey' => '<string>',
'executionOrder' => 123
]
],
'trigger' => [
'eventTriggerType' => '<string>',
'eventName' => '<string>',
'customEventDefinitionId' => '<string>',
'courierFormDefinitionId' => '<string>',
'notificationTriggerParameters' => [
],
'isEnabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.sandbox.usenash.com/v1/workflows/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"nodes\": [\n {\n \"nodeKey\": \"<string>\",\n \"nodeLabel\": \"<string>\",\n \"nodeActionConfig\": {},\n \"nodeFilterConfig\": [\n {}\n ],\n \"isEnabled\": true,\n \"isTrigger\": true\n }\n ],\n \"edges\": [\n {\n \"edgeKey\": \"<string>\",\n \"sourceNodeKey\": \"<string>\",\n \"targetNodeKey\": \"<string>\",\n \"executionOrder\": 123\n }\n ],\n \"trigger\": {\n \"eventTriggerType\": \"<string>\",\n \"eventName\": \"<string>\",\n \"customEventDefinitionId\": \"<string>\",\n \"courierFormDefinitionId\": \"<string>\",\n \"notificationTriggerParameters\": {},\n \"isEnabled\": true\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.sandbox.usenash.com/v1/workflows/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"nodes\": [\n {\n \"nodeKey\": \"<string>\",\n \"nodeLabel\": \"<string>\",\n \"nodeActionConfig\": {},\n \"nodeFilterConfig\": [\n {}\n ],\n \"isEnabled\": true,\n \"isTrigger\": true\n }\n ],\n \"edges\": [\n {\n \"edgeKey\": \"<string>\",\n \"sourceNodeKey\": \"<string>\",\n \"targetNodeKey\": \"<string>\",\n \"executionOrder\": 123\n }\n ],\n \"trigger\": {\n \"eventTriggerType\": \"<string>\",\n \"eventName\": \"<string>\",\n \"customEventDefinitionId\": \"<string>\",\n \"courierFormDefinitionId\": \"<string>\",\n \"notificationTriggerParameters\": {},\n \"isEnabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/workflows/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"nodes\": [\n {\n \"nodeKey\": \"<string>\",\n \"nodeLabel\": \"<string>\",\n \"nodeActionConfig\": {},\n \"nodeFilterConfig\": [\n {}\n ],\n \"isEnabled\": true,\n \"isTrigger\": true\n }\n ],\n \"edges\": [\n {\n \"edgeKey\": \"<string>\",\n \"sourceNodeKey\": \"<string>\",\n \"targetNodeKey\": \"<string>\",\n \"executionOrder\": 123\n }\n ],\n \"trigger\": {\n \"eventTriggerType\": \"<string>\",\n \"eventName\": \"<string>\",\n \"customEventDefinitionId\": \"<string>\",\n \"courierFormDefinitionId\": \"<string>\",\n \"notificationTriggerParameters\": {},\n \"isEnabled\": true\n }\n}"
response = http.request(request)
puts response.read_body[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Available options:
draft, active, inactive, archived, template Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?