Create Edge
curl --request POST \
--url https://api.pathors.com/v1/projects/{projectId}/pathway/edges \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"condition": "<string>"
}
'import requests
url = "https://api.pathors.com/v1/projects/{projectId}/pathway/edges"
payload = {
"id": "<string>",
"source": "<string>",
"target": "<string>",
"condition": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>', source: '<string>', target: '<string>', condition: '<string>'})
};
fetch('https://api.pathors.com/v1/projects/{projectId}/pathway/edges', 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.pathors.com/v1/projects/{projectId}/pathway/edges",
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([
'id' => '<string>',
'source' => '<string>',
'target' => '<string>',
'condition' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.pathors.com/v1/projects/{projectId}/pathway/edges"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.pathors.com/v1/projects/{projectId}/pathway/edges")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/projects/{projectId}/pathway/edges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCreate Edge
Add a new edge connecting two nodes
POST
/
v1
/
projects
/
{projectId}
/
pathway
/
edges
Create Edge
curl --request POST \
--url https://api.pathors.com/v1/projects/{projectId}/pathway/edges \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"condition": "<string>"
}
'import requests
url = "https://api.pathors.com/v1/projects/{projectId}/pathway/edges"
payload = {
"id": "<string>",
"source": "<string>",
"target": "<string>",
"condition": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>', source: '<string>', target: '<string>', condition: '<string>'})
};
fetch('https://api.pathors.com/v1/projects/{projectId}/pathway/edges', 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.pathors.com/v1/projects/{projectId}/pathway/edges",
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([
'id' => '<string>',
'source' => '<string>',
'target' => '<string>',
'condition' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.pathors.com/v1/projects/{projectId}/pathway/edges"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.pathors.com/v1/projects/{projectId}/pathway/edges")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/projects/{projectId}/pathway/edges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyRequest
POST https://api.pathors.com/v1/projects/{projectId}/pathway/edges
Path Parameters
The project ID
Headers
Bearer token using your developer key
Body
Optional edge ID. Auto-generated if not provided.
Source node ID
Target node ID
Transition condition (when should the conversation move from source to target)
Response
Returns the created edge with status201.
Returns 400 if the source or target node does not exist.
Example
curl -X POST https://api.pathors.com/v1/projects/{projectId}/pathway/edges \
-H "Authorization: Bearer dk_your_key" \
-H "Content-Type: application/json" \
-d '{
"source": "node-1",
"target": "node-2",
"condition": "User confirms the booking"
}'
{
"data": {
"id": "edge-node-1-node-2-1709827200000",
"source": "node-1",
"target": "node-2",
"data": { "condition": "User confirms the booking" }
}
}
⌘I
