Update TFU Live agent
Saves the whole TFU Live agent: name, prompt (Brain), voice and workflows. Send every field as read, with your changes, and the ifVersion you read. The saved version is set up for calls at once, so tests and calls use it with no separate prepare step. A draft with setup items left is set up for test calls only. setupError says when setup could not start. Saving the prompt by hand is free and runs no AI. Workflows are saved as sent, and nothing rewrites them to match the prompt. To bring the workflows in line with an edited prompt, use POST /api/tfu-live-agents/{id}/sync-workflows. That separate AI action is paid from the agency’s existing wallet balance. Read the new ifVersion before the next edit.
Required scope: agents:write.
Required API key scope: agents:write.
curl --request PATCH \
--url https://api.teamfollowup.ai/api/tfu-live-agents/{id} \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"ifVersion": "REPLACE_WITH_LOADED_VERSION",
"name": "Consultation desk",
"brain": {
"prompt": "Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.",
"capabilities": [
"outreach"
],
"capabilityConfig": {
"workflows": {
"wf_area2k9x": {
"id": "wf_area2k9x",
"name": "Check service area",
"description": "Use when the caller wants to know whether we serve their area.",
"steps": [
{
"id": "zip",
"type": "collect_information",
"config": {
"items": [
{
"id": "zip_code",
"label": "Zip code",
"question": "What is the zip code of the address?",
"type": "text",
"field": "contact.postalCode"
}
]
}
},
{
"id": "coverage",
"type": "check_zip_code",
"config": {
"field": "contact.postalCode",
"codes": [
"10001"
]
},
"outputs": {
"in_area": [
{
"id": "covered",
"type": "steer_agent",
"config": {
"guidance": "Offer a consultation."
}
}
],
"out_of_area": [
{
"id": "outside",
"type": "steer_agent",
"config": {
"guidance": "Explain that this area is not covered."
}
}
]
}
}
]
}
}
}
},
"voice": {
"voiceId": "marin",
"prompt": "Speak at a calm pace and pronounce addresses clearly."
}
}'import requests
url = "https://api.teamfollowup.ai/api/tfu-live-agents/{id}"
payload = {
"ifVersion": "REPLACE_WITH_LOADED_VERSION",
"name": "Consultation desk",
"brain": {
"prompt": "Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.",
"capabilities": ["outreach"],
"capabilityConfig": { "workflows": { "wf_area2k9x": {
"id": "wf_area2k9x",
"name": "Check service area",
"description": "Use when the caller wants to know whether we serve their area.",
"steps": [
{
"id": "zip",
"type": "collect_information",
"config": { "items": [
{
"id": "zip_code",
"label": "Zip code",
"question": "What is the zip code of the address?",
"type": "text",
"field": "contact.postalCode"
}
] }
},
{
"id": "coverage",
"type": "check_zip_code",
"config": {
"field": "contact.postalCode",
"codes": ["10001"]
},
"outputs": {
"in_area": [
{
"id": "covered",
"type": "steer_agent",
"config": { "guidance": "Offer a consultation." }
}
],
"out_of_area": [
{
"id": "outside",
"type": "steer_agent",
"config": { "guidance": "Explain that this area is not covered." }
}
]
}
}
]
} } }
},
"voice": {
"voiceId": "marin",
"prompt": "Speak at a calm pace and pronounce addresses clearly."
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ifVersion: 'REPLACE_WITH_LOADED_VERSION',
name: 'Consultation desk',
brain: {
prompt: 'Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.',
capabilities: ['outreach'],
capabilityConfig: {
workflows: {
wf_area2k9x: {
id: 'wf_area2k9x',
name: 'Check service area',
description: 'Use when the caller wants to know whether we serve their area.',
steps: [
{
id: 'zip',
type: 'collect_information',
config: {
items: [
{
id: 'zip_code',
label: 'Zip code',
question: 'What is the zip code of the address?',
type: 'text',
field: 'contact.postalCode'
}
]
}
},
{
id: 'coverage',
type: 'check_zip_code',
config: {field: 'contact.postalCode', codes: ['10001']},
outputs: {
in_area: [
{
id: 'covered',
type: 'steer_agent',
config: {guidance: 'Offer a consultation.'}
}
],
out_of_area: [
{
id: 'outside',
type: 'steer_agent',
config: {guidance: 'Explain that this area is not covered.'}
}
]
}
}
]
}
}
}
},
voice: {
voiceId: 'marin',
prompt: 'Speak at a calm pace and pronounce addresses clearly.'
}
})
};
fetch('https://api.teamfollowup.ai/api/tfu-live-agents/{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://api.teamfollowup.ai/api/tfu-live-agents/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'ifVersion' => 'REPLACE_WITH_LOADED_VERSION',
'name' => 'Consultation desk',
'brain' => [
'prompt' => 'Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.',
'capabilities' => [
'outreach'
],
'capabilityConfig' => [
'workflows' => [
'wf_area2k9x' => [
'id' => 'wf_area2k9x',
'name' => 'Check service area',
'description' => 'Use when the caller wants to know whether we serve their area.',
'steps' => [
[
'id' => 'zip',
'type' => 'collect_information',
'config' => [
'items' => [
[
'id' => 'zip_code',
'label' => 'Zip code',
'question' => 'What is the zip code of the address?',
'type' => 'text',
'field' => 'contact.postalCode'
]
]
]
],
[
'id' => 'coverage',
'type' => 'check_zip_code',
'config' => [
'field' => 'contact.postalCode',
'codes' => [
'10001'
]
],
'outputs' => [
'in_area' => [
[
'id' => 'covered',
'type' => 'steer_agent',
'config' => [
'guidance' => 'Offer a consultation.'
]
]
],
'out_of_area' => [
[
'id' => 'outside',
'type' => 'steer_agent',
'config' => [
'guidance' => 'Explain that this area is not covered.'
]
]
]
]
]
]
]
]
]
],
'voice' => [
'voiceId' => 'marin',
'prompt' => 'Speak at a calm pace and pronounce addresses clearly.'
]
]),
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://api.teamfollowup.ai/api/tfu-live-agents/{id}"
payload := strings.NewReader("{\n \"ifVersion\": \"REPLACE_WITH_LOADED_VERSION\",\n \"name\": \"Consultation desk\",\n \"brain\": {\n \"prompt\": \"Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.\",\n \"capabilities\": [\n \"outreach\"\n ],\n \"capabilityConfig\": {\n \"workflows\": {\n \"wf_area2k9x\": {\n \"id\": \"wf_area2k9x\",\n \"name\": \"Check service area\",\n \"description\": \"Use when the caller wants to know whether we serve their area.\",\n \"steps\": [\n {\n \"id\": \"zip\",\n \"type\": \"collect_information\",\n \"config\": {\n \"items\": [\n {\n \"id\": \"zip_code\",\n \"label\": \"Zip code\",\n \"question\": \"What is the zip code of the address?\",\n \"type\": \"text\",\n \"field\": \"contact.postalCode\"\n }\n ]\n }\n },\n {\n \"id\": \"coverage\",\n \"type\": \"check_zip_code\",\n \"config\": {\n \"field\": \"contact.postalCode\",\n \"codes\": [\n \"10001\"\n ]\n },\n \"outputs\": {\n \"in_area\": [\n {\n \"id\": \"covered\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Offer a consultation.\"\n }\n }\n ],\n \"out_of_area\": [\n {\n \"id\": \"outside\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Explain that this area is not covered.\"\n }\n }\n ]\n }\n }\n ]\n }\n }\n }\n },\n \"voice\": {\n \"voiceId\": \"marin\",\n \"prompt\": \"Speak at a calm pace and pronounce addresses clearly.\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.teamfollowup.ai/api/tfu-live-agents/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ifVersion\": \"REPLACE_WITH_LOADED_VERSION\",\n \"name\": \"Consultation desk\",\n \"brain\": {\n \"prompt\": \"Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.\",\n \"capabilities\": [\n \"outreach\"\n ],\n \"capabilityConfig\": {\n \"workflows\": {\n \"wf_area2k9x\": {\n \"id\": \"wf_area2k9x\",\n \"name\": \"Check service area\",\n \"description\": \"Use when the caller wants to know whether we serve their area.\",\n \"steps\": [\n {\n \"id\": \"zip\",\n \"type\": \"collect_information\",\n \"config\": {\n \"items\": [\n {\n \"id\": \"zip_code\",\n \"label\": \"Zip code\",\n \"question\": \"What is the zip code of the address?\",\n \"type\": \"text\",\n \"field\": \"contact.postalCode\"\n }\n ]\n }\n },\n {\n \"id\": \"coverage\",\n \"type\": \"check_zip_code\",\n \"config\": {\n \"field\": \"contact.postalCode\",\n \"codes\": [\n \"10001\"\n ]\n },\n \"outputs\": {\n \"in_area\": [\n {\n \"id\": \"covered\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Offer a consultation.\"\n }\n }\n ],\n \"out_of_area\": [\n {\n \"id\": \"outside\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Explain that this area is not covered.\"\n }\n }\n ]\n }\n }\n ]\n }\n }\n }\n },\n \"voice\": {\n \"voiceId\": \"marin\",\n \"prompt\": \"Speak at a calm pace and pronounce addresses clearly.\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.teamfollowup.ai/api/tfu-live-agents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ifVersion\": \"REPLACE_WITH_LOADED_VERSION\",\n \"name\": \"Consultation desk\",\n \"brain\": {\n \"prompt\": \"Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.\",\n \"capabilities\": [\n \"outreach\"\n ],\n \"capabilityConfig\": {\n \"workflows\": {\n \"wf_area2k9x\": {\n \"id\": \"wf_area2k9x\",\n \"name\": \"Check service area\",\n \"description\": \"Use when the caller wants to know whether we serve their area.\",\n \"steps\": [\n {\n \"id\": \"zip\",\n \"type\": \"collect_information\",\n \"config\": {\n \"items\": [\n {\n \"id\": \"zip_code\",\n \"label\": \"Zip code\",\n \"question\": \"What is the zip code of the address?\",\n \"type\": \"text\",\n \"field\": \"contact.postalCode\"\n }\n ]\n }\n },\n {\n \"id\": \"coverage\",\n \"type\": \"check_zip_code\",\n \"config\": {\n \"field\": \"contact.postalCode\",\n \"codes\": [\n \"10001\"\n ]\n },\n \"outputs\": {\n \"in_area\": [\n {\n \"id\": \"covered\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Offer a consultation.\"\n }\n }\n ],\n \"out_of_area\": [\n {\n \"id\": \"outside\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Explain that this area is not covered.\"\n }\n }\n ]\n }\n }\n ]\n }\n }\n }\n },\n \"voice\": {\n \"voiceId\": \"marin\",\n \"prompt\": \"Speak at a calm pace and pronounce addresses clearly.\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"agent": {
"id": "tfu_live:example_agent",
"runtime": "tfu_live",
"name": "Consultation desk",
"brain": {
"prompt": "Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.",
"capabilities": [
"outreach"
],
"capabilityConfig": {
"workflows": {
"wf_area2k9x": {
"id": "wf_area2k9x",
"name": "Check service area",
"description": "Use when the caller wants to know whether we serve their area.",
"steps": [
{
"id": "zip",
"type": "collect_information",
"config": {
"items": [
{
"id": "zip_code",
"label": "Zip code",
"question": "What is the zip code of the address?",
"type": "text",
"field": "contact.postalCode"
}
]
}
},
{
"id": "coverage",
"type": "check_zip_code",
"config": {
"field": "contact.postalCode",
"codes": [
"10001"
]
},
"outputs": {
"in_area": [
{
"id": "covered",
"type": "steer_agent",
"config": {
"guidance": "Offer a consultation."
}
}
],
"out_of_area": [
{
"id": "outside",
"type": "steer_agent",
"config": {
"guidance": "Explain that this area is not covered."
}
}
]
}
}
]
}
}
}
},
"voice": {
"voiceId": "marin",
"prompt": "Speak at a calm pace and pronounce addresses clearly."
},
"authoring": {
"editable": true,
"reasons": []
},
"orb": {
"style": "default"
},
"ifVersion": "3f2b9c0d1e",
"setup": {
"status": "preparing",
"revision": 2
}
},
"setupStarted": true
}
}Authorizations
Path Parameters
Query Parameters
Body
The whole agent as it should be after the edit: { ifVersion, name, brain, voice }, with ifVersion the version you read.
false: the agent only texts. It is never called: no lead dials, callbacks, incoming calls or phone tests. It needs Chat (the messaging capability) and no Schedule AI call or Transfer step, and its campaign texts from the CRM's own number, so it needs no phone number. Omit, or true, for an agent that calls.
true: turn calls off even though the agent's live campaign still has calls queued for leads, knowing those calls will not be made. Without it, an edit that turns calls off while any are queued is refused with 409 TFU_LIVE_CALLS_SCHEDULED and the count in scheduledCalls, and nothing is saved. Not stored on the agent.
curl --request PATCH \
--url https://api.teamfollowup.ai/api/tfu-live-agents/{id} \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"ifVersion": "REPLACE_WITH_LOADED_VERSION",
"name": "Consultation desk",
"brain": {
"prompt": "Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.",
"capabilities": [
"outreach"
],
"capabilityConfig": {
"workflows": {
"wf_area2k9x": {
"id": "wf_area2k9x",
"name": "Check service area",
"description": "Use when the caller wants to know whether we serve their area.",
"steps": [
{
"id": "zip",
"type": "collect_information",
"config": {
"items": [
{
"id": "zip_code",
"label": "Zip code",
"question": "What is the zip code of the address?",
"type": "text",
"field": "contact.postalCode"
}
]
}
},
{
"id": "coverage",
"type": "check_zip_code",
"config": {
"field": "contact.postalCode",
"codes": [
"10001"
]
},
"outputs": {
"in_area": [
{
"id": "covered",
"type": "steer_agent",
"config": {
"guidance": "Offer a consultation."
}
}
],
"out_of_area": [
{
"id": "outside",
"type": "steer_agent",
"config": {
"guidance": "Explain that this area is not covered."
}
}
]
}
}
]
}
}
}
},
"voice": {
"voiceId": "marin",
"prompt": "Speak at a calm pace and pronounce addresses clearly."
}
}'import requests
url = "https://api.teamfollowup.ai/api/tfu-live-agents/{id}"
payload = {
"ifVersion": "REPLACE_WITH_LOADED_VERSION",
"name": "Consultation desk",
"brain": {
"prompt": "Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.",
"capabilities": ["outreach"],
"capabilityConfig": { "workflows": { "wf_area2k9x": {
"id": "wf_area2k9x",
"name": "Check service area",
"description": "Use when the caller wants to know whether we serve their area.",
"steps": [
{
"id": "zip",
"type": "collect_information",
"config": { "items": [
{
"id": "zip_code",
"label": "Zip code",
"question": "What is the zip code of the address?",
"type": "text",
"field": "contact.postalCode"
}
] }
},
{
"id": "coverage",
"type": "check_zip_code",
"config": {
"field": "contact.postalCode",
"codes": ["10001"]
},
"outputs": {
"in_area": [
{
"id": "covered",
"type": "steer_agent",
"config": { "guidance": "Offer a consultation." }
}
],
"out_of_area": [
{
"id": "outside",
"type": "steer_agent",
"config": { "guidance": "Explain that this area is not covered." }
}
]
}
}
]
} } }
},
"voice": {
"voiceId": "marin",
"prompt": "Speak at a calm pace and pronounce addresses clearly."
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ifVersion: 'REPLACE_WITH_LOADED_VERSION',
name: 'Consultation desk',
brain: {
prompt: 'Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.',
capabilities: ['outreach'],
capabilityConfig: {
workflows: {
wf_area2k9x: {
id: 'wf_area2k9x',
name: 'Check service area',
description: 'Use when the caller wants to know whether we serve their area.',
steps: [
{
id: 'zip',
type: 'collect_information',
config: {
items: [
{
id: 'zip_code',
label: 'Zip code',
question: 'What is the zip code of the address?',
type: 'text',
field: 'contact.postalCode'
}
]
}
},
{
id: 'coverage',
type: 'check_zip_code',
config: {field: 'contact.postalCode', codes: ['10001']},
outputs: {
in_area: [
{
id: 'covered',
type: 'steer_agent',
config: {guidance: 'Offer a consultation.'}
}
],
out_of_area: [
{
id: 'outside',
type: 'steer_agent',
config: {guidance: 'Explain that this area is not covered.'}
}
]
}
}
]
}
}
}
},
voice: {
voiceId: 'marin',
prompt: 'Speak at a calm pace and pronounce addresses clearly.'
}
})
};
fetch('https://api.teamfollowup.ai/api/tfu-live-agents/{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://api.teamfollowup.ai/api/tfu-live-agents/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'ifVersion' => 'REPLACE_WITH_LOADED_VERSION',
'name' => 'Consultation desk',
'brain' => [
'prompt' => 'Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.',
'capabilities' => [
'outreach'
],
'capabilityConfig' => [
'workflows' => [
'wf_area2k9x' => [
'id' => 'wf_area2k9x',
'name' => 'Check service area',
'description' => 'Use when the caller wants to know whether we serve their area.',
'steps' => [
[
'id' => 'zip',
'type' => 'collect_information',
'config' => [
'items' => [
[
'id' => 'zip_code',
'label' => 'Zip code',
'question' => 'What is the zip code of the address?',
'type' => 'text',
'field' => 'contact.postalCode'
]
]
]
],
[
'id' => 'coverage',
'type' => 'check_zip_code',
'config' => [
'field' => 'contact.postalCode',
'codes' => [
'10001'
]
],
'outputs' => [
'in_area' => [
[
'id' => 'covered',
'type' => 'steer_agent',
'config' => [
'guidance' => 'Offer a consultation.'
]
]
],
'out_of_area' => [
[
'id' => 'outside',
'type' => 'steer_agent',
'config' => [
'guidance' => 'Explain that this area is not covered.'
]
]
]
]
]
]
]
]
]
],
'voice' => [
'voiceId' => 'marin',
'prompt' => 'Speak at a calm pace and pronounce addresses clearly.'
]
]),
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://api.teamfollowup.ai/api/tfu-live-agents/{id}"
payload := strings.NewReader("{\n \"ifVersion\": \"REPLACE_WITH_LOADED_VERSION\",\n \"name\": \"Consultation desk\",\n \"brain\": {\n \"prompt\": \"Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.\",\n \"capabilities\": [\n \"outreach\"\n ],\n \"capabilityConfig\": {\n \"workflows\": {\n \"wf_area2k9x\": {\n \"id\": \"wf_area2k9x\",\n \"name\": \"Check service area\",\n \"description\": \"Use when the caller wants to know whether we serve their area.\",\n \"steps\": [\n {\n \"id\": \"zip\",\n \"type\": \"collect_information\",\n \"config\": {\n \"items\": [\n {\n \"id\": \"zip_code\",\n \"label\": \"Zip code\",\n \"question\": \"What is the zip code of the address?\",\n \"type\": \"text\",\n \"field\": \"contact.postalCode\"\n }\n ]\n }\n },\n {\n \"id\": \"coverage\",\n \"type\": \"check_zip_code\",\n \"config\": {\n \"field\": \"contact.postalCode\",\n \"codes\": [\n \"10001\"\n ]\n },\n \"outputs\": {\n \"in_area\": [\n {\n \"id\": \"covered\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Offer a consultation.\"\n }\n }\n ],\n \"out_of_area\": [\n {\n \"id\": \"outside\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Explain that this area is not covered.\"\n }\n }\n ]\n }\n }\n ]\n }\n }\n }\n },\n \"voice\": {\n \"voiceId\": \"marin\",\n \"prompt\": \"Speak at a calm pace and pronounce addresses clearly.\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.teamfollowup.ai/api/tfu-live-agents/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ifVersion\": \"REPLACE_WITH_LOADED_VERSION\",\n \"name\": \"Consultation desk\",\n \"brain\": {\n \"prompt\": \"Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.\",\n \"capabilities\": [\n \"outreach\"\n ],\n \"capabilityConfig\": {\n \"workflows\": {\n \"wf_area2k9x\": {\n \"id\": \"wf_area2k9x\",\n \"name\": \"Check service area\",\n \"description\": \"Use when the caller wants to know whether we serve their area.\",\n \"steps\": [\n {\n \"id\": \"zip\",\n \"type\": \"collect_information\",\n \"config\": {\n \"items\": [\n {\n \"id\": \"zip_code\",\n \"label\": \"Zip code\",\n \"question\": \"What is the zip code of the address?\",\n \"type\": \"text\",\n \"field\": \"contact.postalCode\"\n }\n ]\n }\n },\n {\n \"id\": \"coverage\",\n \"type\": \"check_zip_code\",\n \"config\": {\n \"field\": \"contact.postalCode\",\n \"codes\": [\n \"10001\"\n ]\n },\n \"outputs\": {\n \"in_area\": [\n {\n \"id\": \"covered\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Offer a consultation.\"\n }\n }\n ],\n \"out_of_area\": [\n {\n \"id\": \"outside\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Explain that this area is not covered.\"\n }\n }\n ]\n }\n }\n ]\n }\n }\n }\n },\n \"voice\": {\n \"voiceId\": \"marin\",\n \"prompt\": \"Speak at a calm pace and pronounce addresses clearly.\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.teamfollowup.ai/api/tfu-live-agents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ifVersion\": \"REPLACE_WITH_LOADED_VERSION\",\n \"name\": \"Consultation desk\",\n \"brain\": {\n \"prompt\": \"Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.\",\n \"capabilities\": [\n \"outreach\"\n ],\n \"capabilityConfig\": {\n \"workflows\": {\n \"wf_area2k9x\": {\n \"id\": \"wf_area2k9x\",\n \"name\": \"Check service area\",\n \"description\": \"Use when the caller wants to know whether we serve their area.\",\n \"steps\": [\n {\n \"id\": \"zip\",\n \"type\": \"collect_information\",\n \"config\": {\n \"items\": [\n {\n \"id\": \"zip_code\",\n \"label\": \"Zip code\",\n \"question\": \"What is the zip code of the address?\",\n \"type\": \"text\",\n \"field\": \"contact.postalCode\"\n }\n ]\n }\n },\n {\n \"id\": \"coverage\",\n \"type\": \"check_zip_code\",\n \"config\": {\n \"field\": \"contact.postalCode\",\n \"codes\": [\n \"10001\"\n ]\n },\n \"outputs\": {\n \"in_area\": [\n {\n \"id\": \"covered\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Offer a consultation.\"\n }\n }\n ],\n \"out_of_area\": [\n {\n \"id\": \"outside\",\n \"type\": \"steer_agent\",\n \"config\": {\n \"guidance\": \"Explain that this area is not covered.\"\n }\n }\n ]\n }\n }\n ]\n }\n }\n }\n },\n \"voice\": {\n \"voiceId\": \"marin\",\n \"prompt\": \"Speak at a calm pace and pronounce addresses clearly.\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"agent": {
"id": "tfu_live:example_agent",
"runtime": "tfu_live",
"name": "Consultation desk",
"brain": {
"prompt": "Help people arrange a consultation. Confirm that their postal code is covered before offering an appointment.",
"capabilities": [
"outreach"
],
"capabilityConfig": {
"workflows": {
"wf_area2k9x": {
"id": "wf_area2k9x",
"name": "Check service area",
"description": "Use when the caller wants to know whether we serve their area.",
"steps": [
{
"id": "zip",
"type": "collect_information",
"config": {
"items": [
{
"id": "zip_code",
"label": "Zip code",
"question": "What is the zip code of the address?",
"type": "text",
"field": "contact.postalCode"
}
]
}
},
{
"id": "coverage",
"type": "check_zip_code",
"config": {
"field": "contact.postalCode",
"codes": [
"10001"
]
},
"outputs": {
"in_area": [
{
"id": "covered",
"type": "steer_agent",
"config": {
"guidance": "Offer a consultation."
}
}
],
"out_of_area": [
{
"id": "outside",
"type": "steer_agent",
"config": {
"guidance": "Explain that this area is not covered."
}
}
]
}
}
]
}
}
}
},
"voice": {
"voiceId": "marin",
"prompt": "Speak at a calm pace and pronounce addresses clearly."
},
"authoring": {
"editable": true,
"reasons": []
},
"orb": {
"style": "default"
},
"ifVersion": "3f2b9c0d1e",
"setup": {
"status": "preparing",
"revision": 2
}
},
"setupStarted": true
}
}