Update scenario
curl --request POST \
--url https://akapulu.com/api/scenarios/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "11111111-2222-3333-4444-555555555555",
"name": "Sales Qualification v2",
"llm_model": "gpt-4.1-mini",
"nodes_json": {
"initial_node": "intro",
"role_instruction": "You are a closer.",
"nodes": {
"intro": {
"task_instruction": "Greet the visitor.",
"respond_immediately": true
}
}
}
}
'import requests
url = "https://akapulu.com/api/scenarios/update"
payload = {
"id": "11111111-2222-3333-4444-555555555555",
"name": "Sales Qualification v2",
"llm_model": "gpt-4.1-mini",
"nodes_json": {
"initial_node": "intro",
"role_instruction": "You are a closer.",
"nodes": { "intro": {
"task_instruction": "Greet the visitor.",
"respond_immediately": True
} }
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '11111111-2222-3333-4444-555555555555',
name: 'Sales Qualification v2',
llm_model: 'gpt-4.1-mini',
nodes_json: {
initial_node: 'intro',
role_instruction: 'You are a closer.',
nodes: {intro: {task_instruction: 'Greet the visitor.', respond_immediately: true}}
}
})
};
fetch('https://akapulu.com/api/scenarios/update', 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://akapulu.com/api/scenarios/update",
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' => '11111111-2222-3333-4444-555555555555',
'name' => 'Sales Qualification v2',
'llm_model' => 'gpt-4.1-mini',
'nodes_json' => [
'initial_node' => 'intro',
'role_instruction' => 'You are a closer.',
'nodes' => [
'intro' => [
'task_instruction' => 'Greet the visitor.',
'respond_immediately' => true
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://akapulu.com/api/scenarios/update"
payload := strings.NewReader("{\n \"id\": \"11111111-2222-3333-4444-555555555555\",\n \"name\": \"Sales Qualification v2\",\n \"llm_model\": \"gpt-4.1-mini\",\n \"nodes_json\": {\n \"initial_node\": \"intro\",\n \"role_instruction\": \"You are a closer.\",\n \"nodes\": {\n \"intro\": {\n \"task_instruction\": \"Greet the visitor.\",\n \"respond_immediately\": true\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://akapulu.com/api/scenarios/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"11111111-2222-3333-4444-555555555555\",\n \"name\": \"Sales Qualification v2\",\n \"llm_model\": \"gpt-4.1-mini\",\n \"nodes_json\": {\n \"initial_node\": \"intro\",\n \"role_instruction\": \"You are a closer.\",\n \"nodes\": {\n \"intro\": {\n \"task_instruction\": \"Greet the visitor.\",\n \"respond_immediately\": true\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://akapulu.com/api/scenarios/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"11111111-2222-3333-4444-555555555555\",\n \"name\": \"Sales Qualification v2\",\n \"llm_model\": \"gpt-4.1-mini\",\n \"nodes_json\": {\n \"initial_node\": \"intro\",\n \"role_instruction\": \"You are a closer.\",\n \"nodes\": {\n \"intro\": {\n \"task_instruction\": \"Greet the visitor.\",\n \"respond_immediately\": true\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "updated",
"id": "11111111-2222-3333-4444-555555555555",
"hosted_links": []
}{
"error": "id is required"
}{
"error": "Invalid API key"
}{
"error": "ConversationConfig not found"
}Scenarios
Update Scenario
Update a scenario. If hosted_links is present, omitted links are deleted (full reconcile). Omit hosted_links to leave existing links unchanged.
POST
/
scenarios
/
update
Update scenario
curl --request POST \
--url https://akapulu.com/api/scenarios/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "11111111-2222-3333-4444-555555555555",
"name": "Sales Qualification v2",
"llm_model": "gpt-4.1-mini",
"nodes_json": {
"initial_node": "intro",
"role_instruction": "You are a closer.",
"nodes": {
"intro": {
"task_instruction": "Greet the visitor.",
"respond_immediately": true
}
}
}
}
'import requests
url = "https://akapulu.com/api/scenarios/update"
payload = {
"id": "11111111-2222-3333-4444-555555555555",
"name": "Sales Qualification v2",
"llm_model": "gpt-4.1-mini",
"nodes_json": {
"initial_node": "intro",
"role_instruction": "You are a closer.",
"nodes": { "intro": {
"task_instruction": "Greet the visitor.",
"respond_immediately": True
} }
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '11111111-2222-3333-4444-555555555555',
name: 'Sales Qualification v2',
llm_model: 'gpt-4.1-mini',
nodes_json: {
initial_node: 'intro',
role_instruction: 'You are a closer.',
nodes: {intro: {task_instruction: 'Greet the visitor.', respond_immediately: true}}
}
})
};
fetch('https://akapulu.com/api/scenarios/update', 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://akapulu.com/api/scenarios/update",
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' => '11111111-2222-3333-4444-555555555555',
'name' => 'Sales Qualification v2',
'llm_model' => 'gpt-4.1-mini',
'nodes_json' => [
'initial_node' => 'intro',
'role_instruction' => 'You are a closer.',
'nodes' => [
'intro' => [
'task_instruction' => 'Greet the visitor.',
'respond_immediately' => true
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://akapulu.com/api/scenarios/update"
payload := strings.NewReader("{\n \"id\": \"11111111-2222-3333-4444-555555555555\",\n \"name\": \"Sales Qualification v2\",\n \"llm_model\": \"gpt-4.1-mini\",\n \"nodes_json\": {\n \"initial_node\": \"intro\",\n \"role_instruction\": \"You are a closer.\",\n \"nodes\": {\n \"intro\": {\n \"task_instruction\": \"Greet the visitor.\",\n \"respond_immediately\": true\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://akapulu.com/api/scenarios/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"11111111-2222-3333-4444-555555555555\",\n \"name\": \"Sales Qualification v2\",\n \"llm_model\": \"gpt-4.1-mini\",\n \"nodes_json\": {\n \"initial_node\": \"intro\",\n \"role_instruction\": \"You are a closer.\",\n \"nodes\": {\n \"intro\": {\n \"task_instruction\": \"Greet the visitor.\",\n \"respond_immediately\": true\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://akapulu.com/api/scenarios/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"11111111-2222-3333-4444-555555555555\",\n \"name\": \"Sales Qualification v2\",\n \"llm_model\": \"gpt-4.1-mini\",\n \"nodes_json\": {\n \"initial_node\": \"intro\",\n \"role_instruction\": \"You are a closer.\",\n \"nodes\": {\n \"intro\": {\n \"task_instruction\": \"Greet the visitor.\",\n \"respond_immediately\": true\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "updated",
"id": "11111111-2222-3333-4444-555555555555",
"hosted_links": []
}{
"error": "id is required"
}{
"error": "Invalid API key"
}{
"error": "ConversationConfig not found"
}Update a scenario’s name,
nodes_json, and optional LLM model.
Required request fields:
idof the scenario to updatenamenodes_json
If you send
hosted_links, the array is a full replace. Links omitted from the array are deleted. Include each existing link’s id to keep or edit it. Omit hosted_links entirely to leave existing links unchanged.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Scenario flow JSON. See the Using JSON guide for the full contract.
Show child attributes
Show child attributes
OpenAI chat model for this scenario. Defaults to gpt-4.1-mini. Full-size models require a paid plan.
Available options:
gpt-4.1-nano, gpt-4.1-mini, gpt-4.1, gpt-5.4-nano, gpt-5.4-mini, gpt-5.4 If present, this array is the full set of hosted links after the update. Links omitted from the array are deleted. Omit this field to leave existing links unchanged.
Show child attributes
Show child attributes
⌘I

