Create a new flow
curl --request POST \
--url https://api.dualship.run/api/v1/flows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Workspace-Id: <x-workspace-id>' \
--data '
{
"name": "<string>",
"slug": "<string>",
"trigger": {
"type": "<string>",
"config": [
123
]
},
"description": "<string>",
"edges": [
123
],
"metadata": [
123
],
"nodes": [
123
]
}
'import requests
url = "https://api.dualship.run/api/v1/flows"
payload = {
"name": "<string>",
"slug": "<string>",
"trigger": {
"type": "<string>",
"config": [123]
},
"description": "<string>",
"edges": [123],
"metadata": [123],
"nodes": [123]
}
headers = {
"X-Workspace-Id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Workspace-Id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
trigger: {type: '<string>', config: [123]},
description: '<string>',
edges: [123],
metadata: [123],
nodes: [123]
})
};
fetch('https://api.dualship.run/api/v1/flows', 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",
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([
'name' => '<string>',
'slug' => '<string>',
'trigger' => [
'type' => '<string>',
'config' => [
123
]
],
'description' => '<string>',
'edges' => [
123
],
'metadata' => [
123
],
'nodes' => [
123
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"config\": [\n 123\n ]\n },\n \"description\": \"<string>\",\n \"edges\": [\n 123\n ],\n \"metadata\": [\n 123\n ],\n \"nodes\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.dualship.run/api/v1/flows")
.header("X-Workspace-Id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"config\": [\n 123\n ]\n },\n \"description\": \"<string>\",\n \"edges\": [\n 123\n ],\n \"metadata\": [\n 123\n ],\n \"nodes\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualship.run/api/v1/flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Workspace-Id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"config\": [\n 123\n ]\n },\n \"description\": \"<string>\",\n \"edges\": [\n 123\n ],\n \"metadata\": [\n 123\n ],\n \"nodes\": [\n 123\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": "INTERNAL_ERROR",
"error": "internal server error"
}flows
Create a new flow
Create a new API flow
POST
/
api
/
v1
/
flows
Create a new flow
curl --request POST \
--url https://api.dualship.run/api/v1/flows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Workspace-Id: <x-workspace-id>' \
--data '
{
"name": "<string>",
"slug": "<string>",
"trigger": {
"type": "<string>",
"config": [
123
]
},
"description": "<string>",
"edges": [
123
],
"metadata": [
123
],
"nodes": [
123
]
}
'import requests
url = "https://api.dualship.run/api/v1/flows"
payload = {
"name": "<string>",
"slug": "<string>",
"trigger": {
"type": "<string>",
"config": [123]
},
"description": "<string>",
"edges": [123],
"metadata": [123],
"nodes": [123]
}
headers = {
"X-Workspace-Id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Workspace-Id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
trigger: {type: '<string>', config: [123]},
description: '<string>',
edges: [123],
metadata: [123],
nodes: [123]
})
};
fetch('https://api.dualship.run/api/v1/flows', 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",
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([
'name' => '<string>',
'slug' => '<string>',
'trigger' => [
'type' => '<string>',
'config' => [
123
]
],
'description' => '<string>',
'edges' => [
123
],
'metadata' => [
123
],
'nodes' => [
123
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"config\": [\n 123\n ]\n },\n \"description\": \"<string>\",\n \"edges\": [\n 123\n ],\n \"metadata\": [\n 123\n ],\n \"nodes\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.dualship.run/api/v1/flows")
.header("X-Workspace-Id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"config\": [\n 123\n ]\n },\n \"description\": \"<string>\",\n \"edges\": [\n 123\n ],\n \"metadata\": [\n 123\n ],\n \"nodes\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualship.run/api/v1/flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Workspace-Id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"config\": [\n 123\n ]\n },\n \"description\": \"<string>\",\n \"edges\": [\n 123\n ],\n \"metadata\": [\n 123\n ],\n \"nodes\": [\n 123\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": "INTERNAL_ERROR",
"error": "internal server error"
}Authorizations
JWT Bearer token authentication
Headers
Workspace ID
Query Parameters
Project ID (uses default if not specified)
Body
application/json
Flow configuration
Response
Flow created successfully
Example:
"2024-01-15T10:30:00Z"
Example:
"Handles user registration and welcome email"
Example:
"550e8400-e29b-41d4-a716-446655440000"
Example:
"User Registration Flow"
Example:
"550e8400-e29b-41d4-a716-446655440001"
Example:
"user-registration"
Example:
"active"
Example:
"550e8400-e29b-41d4-a716-446655440002"
Example:
"2024-01-15T10:30:00Z"
Was this page helpful?
⌘I