Skip to main content
PUT
/
api
/
v1
/
flows
/
{id}
Update a flow
curl --request PUT \
  --url https://api.dualship.run/api/v1/flows/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Workspace-Id: <x-workspace-id>' \
  --data '
{
  "description": "<string>",
  "edges": [
    123
  ],
  "metadata": [
    123
  ],
  "name": "<string>",
  "nodes": [
    123
  ],
  "slug": "<string>",
  "status": "<string>",
  "trigger": {
    "config": [
      123
    ],
    "type": "<string>"
  }
}
'
import requests

url = "https://api.dualship.run/api/v1/flows/{id}"

payload = {
"description": "<string>",
"edges": [123],
"metadata": [123],
"name": "<string>",
"nodes": [123],
"slug": "<string>",
"status": "<string>",
"trigger": {
"config": [123],
"type": "<string>"
}
}
headers = {
"X-Workspace-Id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {
'X-Workspace-Id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: '<string>',
edges: [123],
metadata: [123],
name: '<string>',
nodes: [123],
slug: '<string>',
status: '<string>',
trigger: {config: [123], type: '<string>'}
})
};

fetch('https://api.dualship.run/api/v1/flows/{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.dualship.run/api/v1/flows/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'edges' => [
123
],
'metadata' => [
123
],
'name' => '<string>',
'nodes' => [
123
],
'slug' => '<string>',
'status' => '<string>',
'trigger' => [
'config' => [
123
],
'type' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Workspace-Id: <x-workspace-id>"
],
]);

$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.dualship.run/api/v1/flows/{id}"

payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"edges\": [\n 123\n ],\n \"metadata\": [\n 123\n ],\n \"name\": \"<string>\",\n \"nodes\": [\n 123\n ],\n \"slug\": \"<string>\",\n \"status\": \"<string>\",\n \"trigger\": {\n \"config\": [\n 123\n ],\n \"type\": \"<string>\"\n }\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("X-Workspace-Id", "<x-workspace-id>")
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.put("https://api.dualship.run/api/v1/flows/{id}")
.header("X-Workspace-Id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"edges\": [\n 123\n ],\n \"metadata\": [\n 123\n ],\n \"name\": \"<string>\",\n \"nodes\": [\n 123\n ],\n \"slug\": \"<string>\",\n \"status\": \"<string>\",\n \"trigger\": {\n \"config\": [\n 123\n ],\n \"type\": \"<string>\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.dualship.run/api/v1/flows/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-Workspace-Id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"edges\": [\n 123\n ],\n \"metadata\": [\n 123\n ],\n \"name\": \"<string>\",\n \"nodes\": [\n 123\n ],\n \"slug\": \"<string>\",\n \"status\": \"<string>\",\n \"trigger\": {\n \"config\": [\n 123\n ],\n \"type\": \"<string>\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "created_at": "2024-01-15T10:30:00Z",
  "description": "Handles user registration and welcome email",
  "edges": [
    123
  ],
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "metadata": [
    123
  ],
  "name": "User Registration Flow",
  "nodes": [
    123
  ],
  "project_id": "550e8400-e29b-41d4-a716-446655440001",
  "slug": "user-registration",
  "status": "active",
  "trigger_config": [
    123
  ],
  "trigger_type_id": "550e8400-e29b-41d4-a716-446655440002",
  "updated_at": "2024-01-15T10:30:00Z"
}
{
"code": "BAD_REQUEST",
"error": "invalid request parameters"
}
{
"code": "UNAUTHORIZED",
"error": "unauthorized"
}
{
"code": "NOT_FOUND",
"error": "resource not found"
}
{
"code": "INTERNAL_ERROR",
"error": "internal server error"
}

Authorizations

Authorization
string
header
required

JWT Bearer token authentication

Headers

X-Workspace-Id
string
required

Workspace ID

Path Parameters

id
string
required

Flow ID

Body

application/json

Flow configuration

description
string
edges
integer[]
metadata
integer[]
name
string
nodes
integer[]
slug
string
status
string
trigger
object

Response

Flow updated successfully

created_at
string
Example:

"2024-01-15T10:30:00Z"

description
string
Example:

"Handles user registration and welcome email"

edges
integer[]
id
string
Example:

"550e8400-e29b-41d4-a716-446655440000"

metadata
integer[]
name
string
Example:

"User Registration Flow"

nodes
integer[]
project_id
string
Example:

"550e8400-e29b-41d4-a716-446655440001"

slug
string
Example:

"user-registration"

status
string
Example:

"active"

trigger_config
integer[]
trigger_type_id
string
Example:

"550e8400-e29b-41d4-a716-446655440002"

updated_at
string
Example:

"2024-01-15T10:30:00Z"