Update Pathway
curl --request POST \
--url https://app.luly.ai/api/v1/convo_pathway/{pathway_id} \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://app.luly.ai/api/v1/convo_pathway/{pathway_id}"
payload = {
"name": "<string>",
"description": "<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({name: '<string>', description: '<string>'})
};
fetch('https://app.luly.ai/api/v1/convo_pathway/{pathway_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://app.luly.ai/api/v1/convo_pathway/{pathway_id}",
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>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$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://app.luly.ai/api/v1/convo_pathway/{pathway_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<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://app.luly.ai/api/v1/convo_pathway/{pathway_id}")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.luly.ai/api/v1/convo_pathway/{pathway_id}")
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 \"name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Pathway updated successfully",
"pathway_data": {
"pathway_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1",
"name": "Updated Demo Pathway",
"description": "This is an updated description",
"nodes": [
{
"id": "1",
"data": {
"name": "Start",
"text": "Hey there, how are you doing today?",
"isStart": true,
},
"type": "Default"
},
{
"id": "randomnode_1710288752186",
"data": {
"name": "End call",
"prompt": "Click 'Add New Node' on the right to add a new node",
},
"type": "End Call"
},
{
"id": "randomnode_1710288871721",
"data": {
"name": "New Node",
"prompt": "Click 'Add New Node' on the right to add a new node",
},
"type": "Default"
}
],
"edges": [
{
"id": "1",
"source": "1",
"target": "randomnode_1710288752186",
"data": {
"name": "End call",
"prompt": "Click 'Add New Node' on the right to add a new node",
}
},
{
"id": "2",
"source": "1",
"target": "randomnode_1710288871721",
"data": {
"name": "New Node",
"prompt": "Click 'Add New Node' on the right to add a new node",
}
}
]
}
}
Conversational Pathways
Update Pathway
Update a conversational pathway’s fields - including name, description, nodes and edges.
POST
/
v1
/
convo_pathway
/
{pathway_id}
Update Pathway
curl --request POST \
--url https://app.luly.ai/api/v1/convo_pathway/{pathway_id} \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://app.luly.ai/api/v1/convo_pathway/{pathway_id}"
payload = {
"name": "<string>",
"description": "<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({name: '<string>', description: '<string>'})
};
fetch('https://app.luly.ai/api/v1/convo_pathway/{pathway_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://app.luly.ai/api/v1/convo_pathway/{pathway_id}",
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>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$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://app.luly.ai/api/v1/convo_pathway/{pathway_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<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://app.luly.ai/api/v1/convo_pathway/{pathway_id}")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.luly.ai/api/v1/convo_pathway/{pathway_id}")
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 \"name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Pathway updated successfully",
"pathway_data": {
"pathway_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1",
"name": "Updated Demo Pathway",
"description": "This is an updated description",
"nodes": [
{
"id": "1",
"data": {
"name": "Start",
"text": "Hey there, how are you doing today?",
"isStart": true,
},
"type": "Default"
},
{
"id": "randomnode_1710288752186",
"data": {
"name": "End call",
"prompt": "Click 'Add New Node' on the right to add a new node",
},
"type": "End Call"
},
{
"id": "randomnode_1710288871721",
"data": {
"name": "New Node",
"prompt": "Click 'Add New Node' on the right to add a new node",
},
"type": "Default"
}
],
"edges": [
{
"id": "1",
"source": "1",
"target": "randomnode_1710288752186",
"data": {
"name": "End call",
"prompt": "Click 'Add New Node' on the right to add a new node",
}
},
{
"id": "2",
"source": "1",
"target": "randomnode_1710288871721",
"data": {
"name": "New Node",
"prompt": "Click 'Add New Node' on the right to add a new node",
}
}
]
}
}
Headers
string
required
Your API key for authentication.
Path Parameters
string
required
The unique identifier of the conversational pathway you want to update.
Body
string
The name of the conversational pathway
string
A description of the pathway
array of objects
Data about all the nodes in the pathway.Examples of JSON objects for nodes (Horizontal scroll the tab bar to see more examples)
{
"id": "1",
"type": "Default"
"data": {
"name": "Start",
"text": "Hey there, how are you doing today?",
"isStart": true,
},...
}
{
"id": "randomnode_1710288871721",
"type": "Default"
"data": {
"name": "New Node",
"text": "Select a node or edge and press backspace to remove it",
"globalPrompt": "This is a phone call. Do not use exclamation marks.\n\nConvert 24HR format timings to 12 HR format - e.g 14:00 should be written as 2 PM.",
},
}
`
`json End Node
{
"id": "randomnode_1710288752186",
"type": "End Call"
"data": {
"name": "End call",
"prompt": "Say goodbye to the user",
},
}
{
"id": "randomnode_1710288752186",
"type": "Webhook",
"data": {
"url": "https://api.luly.ai/reservation",
"body": "{\n \"date\" : \"{{date}}\",\n \"time\" : \"{{time}}\",\n \"guests\": {{number_of_people}}\n}",
"name": "Reservation Booking",
"text": "Please give me a moment as I check our bookings..",
"method": "POST",
"extractVars": [
[
"date",
"string",
"Desired Date of reservation, in MM/DD/YYYY format"
],
[
"time",
"string",
"Desired Time of Reservation in 24HR Format e.g 13:30"
],
[
"number_of_people",
"integer",
"Number of people for the reservation"
]
],
"responseData": [
{
"data": "$.reserved",
"name": "reservation_success",
"context": ""
},
{
"data": "$.available_slots",
"name": "available_slots",
"context": "Available slots for the date provided"
}
],
"responsePathways": [
[
"reservation_success",
"==",
"true",
{
"id": "randomnode_1710288752186",
"name": "Reservation Successful"
}
],
[
"reservation_success",
"==",
"false",
{
"id": "randomnode_1712265110018",
"name": "Find new timeslot"
}
]
]
}
}
{
"id": "randomnode_1710288752186",
"type": "Webhook",
"data": {
"url": "https://api.luly.ai/reservation",
"body": "{\n \"date\" : \"{{date}}\",\n \"time\" : \"{{time}}\",\n \"guests\": {{number_of_people}}\n}",
"name": "Reservation Booking",
"text": "Please give me a moment as I check our bookings..",
"method": "POST",
"extractVars": [
[
"date",
"string",
"Desired Date of reservation, in MM/DD/YYYY format"
],
[
"time",
"string",
"Desired Time of Reservation in 24HR Format e.g 13:30"
],
[
"number_of_people",
"integer",
"Number of people for the reservation"
]
],
"responseData": [
{
"data": "$.reserved",
"name": "reservation_success",
"context": ""
},
{
"data": "$.available_slots",
"name": "available_slots",
"context": "Available slots for the date provided"
}
],
"responsePathways": [
[
"reservation_success",
"==",
"true",
{
"id": "randomnode_1710288752186",
"name": "Reservation Successful"
}
],
[
"reservation_success",
"==",
"false",
{
"id": "randomnode_1712265110018",
"name": "Find new timeslot"
}
]
]
}
}
{
"id": "randomnode_1710288752186",
"type": "Webhook",
"data": {
"url": "https://api.luly.ai/reservation",
"body": "{\n \"date\" : \"{{date}}\",\n \"time\" : \"{{time}}\",\n \"guests\": {{number_of_people}}\n}",
"name": "Reservation Booking",
"text": "Please give me a moment as I check our bookings..",
"method": "POST",
"extractVars": [
[
"date",
"string",
"Desired Date of reservation, in MM/DD/YYYY format"
],
[
"time",
"string",
"Desired Time of Reservation in 24HR Format e.g 13:30"
],
[
"number_of_people",
"integer",
"Number of people for the reservation"
]
],
"responseData": [
{
"data": "$.reserved",
"name": "reservation_success",
"context": ""
},
{
"data": "$.available_slots",
"name": "available_slots",
"context": "Available slots for the date provided"
}
],
"responsePathways": [
[
"reservation_success",
"==",
"true",
{
"id": "randomnode_1710288752186",
"name": "Reservation Successful"
}
],
[
"reservation_success",
"==",
"false",
{
"id": "randomnode_1712265110018",
"name": "Find new timeslot"
}
]
]
}
}
{
"id": "randomnode_1710288752186",
"type": "Transfer Call",
"data": {
"name": "Transferring the call",
"text": "Transferring the call now. Please hold.."
"transferNumber": "+19547951234"
}
}
Node Data Object Parameters
Node Data Object Parameters
name— name of the nodeisStart— whether the node is the start node. There can only be 1 start node in a pathway. Eithertrueorfalse.isGlobal— whether the node is a global node. Global nodes are nodes that can be used in multiple pathways. Eithertrueorfalse.globalLabel— the label of the global node. Should be present ifisGlobalis true.type— Type of the node. Can beDefault,End Call,Transfer Node,Knowledge Base, orWebhook.text— If static text is chosen, this is the text that will be said to the user.prompt— If dynamic text is chosen, this is the prompt that will be shown to the user.condition— The condition that needs to be met to proceed from this node.transferNumber- If the node is a transfer node, this is the number to which the call will be transferred.
kb- If the node is a knowledge base node, this is the knowledge base that will be used.
pathwayExamples- The fine-tuning examples for the agent at this node for the pathways chosen
conditionExamples- The fine-tuning examples for the condition at this node for the condition chosen
dialogueExamples- The fine-tuning examples for the dialogue at this node for the dialogue chosen.
modelOptionsmodelName— The name of the model to be used for this node.interruptionThreshold— The sensitivity to interruptions at this nodetemperature— The temperature of the model.
extractVars- An array of array of strings. [[
varName,varType,varDescription]] e.g[["name", "string", "The name of the user"], ["age", "integer", "The age of the user"]]
- An array of array of strings. [[
array of objects
Data about all the edges in the pathway.
Egde Object Parameters
Egde Object Parameters
id— unique id of the edgesource— id of the source nodetarget— id of the target nodelabel— Label for this edge. This is what the agent will use to decide which path to take.
Response
string
Can be
success or error.string
A unique identifier for the pathway (present only if status is
success).array of objects
Data about all the nodes in the pathway.
array of objects
Data about all the edges in the pathway.
{
"status": "success",
"message": "Pathway updated successfully",
"pathway_data": {
"pathway_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1",
"name": "Updated Demo Pathway",
"description": "This is an updated description",
"nodes": [
{
"id": "1",
"data": {
"name": "Start",
"text": "Hey there, how are you doing today?",
"isStart": true,
},
"type": "Default"
},
{
"id": "randomnode_1710288752186",
"data": {
"name": "End call",
"prompt": "Click 'Add New Node' on the right to add a new node",
},
"type": "End Call"
},
{
"id": "randomnode_1710288871721",
"data": {
"name": "New Node",
"prompt": "Click 'Add New Node' on the right to add a new node",
},
"type": "Default"
}
],
"edges": [
{
"id": "1",
"source": "1",
"target": "randomnode_1710288752186",
"data": {
"name": "End call",
"prompt": "Click 'Add New Node' on the right to add a new node",
}
},
{
"id": "2",
"source": "1",
"target": "randomnode_1710288871721",
"data": {
"name": "New Node",
"prompt": "Click 'Add New Node' on the right to add a new node",
}
}
]
}
}
⌘I