Skip to main content
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>"
}
'

Request

POST https://api.pathors.com/v1/projects/{projectId}/pathway/edges

Path Parameters

projectId
string
required
The project ID

Headers

Authorization
string
required
Bearer token using your developer key

Body

id
string
Optional edge ID. Auto-generated if not provided.
source
string
required
Source node ID
target
string
required
Target node ID
condition
string
required
Transition condition (when should the conversation move from source to target)

Response

Returns the created edge with status 201. 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" }
  }
}