curl --request PUT \
--url https://sandbox.voice.miraiminds.co/v2/agents/{agent_id}/flow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"nodes": [
{
"id": "persona",
"type": "globalNode",
"data": {
"name": "Persona and rules",
"prompt": "You are Ashu, a service advisor at Mirai Motors.\nSpeak everyday Hindi in Devanagari; common English words such as service, slot and workshop are fine.\nSay one or two short sentences, then listen.\nNever promise a discount, a price or a pickup.\nWhen the condition of one of your functions is met, call it at once without saying anything first."
}
},
{
"id": "identity",
"type": "startCall",
"data": {
"name": "Confirm the customer",
"greeting": "नमस्ते, मैं मिराई मोटर्स से आशु बोल रहा हूं. क्या मेरी बात {{name}} जी से हो रही है?",
"prompt": "You have asked whether you are speaking with {{name}}. Wait for the answer.\nIf they confirm, call confirmed_identity.\nIf it is someone else or a wrong number, call wrong_person.\nDo not mention the car or the service before they confirm."
}
},
{
"id": "offer_slot",
"type": "agentNode",
"data": {
"name": "Book the service",
"prompt": "Tell them their {{vehicle}} is due for service on {{due_date}}, and ask which day they can bring it to the workshop.\nWhen they name a day, read it back once and call slot_booked.\nIf they are busy, ask once when to call them back, then call not_now.\nIf they do not want to book at all, call not_now.",
"extraction_enabled": true,
"extraction_variables": [
{
"name": "preferred_day",
"type": "string",
"prompt": "The day the customer chose for the service, in their words, for example Saturday or 20 August."
},
{
"name": "callback_time",
"type": "string",
"prompt": "When the customer asked to be called back, in their words. Empty if they did not ask."
}
]
}
},
{
"id": "goodbye",
"type": "endCall",
"data": {
"name": "Close",
"prompt": "In one sentence, repeat what was agreed. Thank them and say goodbye. Do not ask anything else.",
"allow_interrupt": false
}
},
{
"id": "not_customer",
"type": "endCall",
"data": {
"name": "Wrong person",
"prompt": "Apologise for the trouble and say goodbye. Do not mention the car or the service."
}
}
],
"edges": [
{
"id": "e1",
"source": "identity",
"target": "offer_slot",
"data": {
"label": "confirmed_identity",
"condition": "The caller confirmed they are the customer you asked for."
}
},
{
"id": "e2",
"source": "identity",
"target": "not_customer",
"data": {
"label": "wrong_person",
"condition": "The caller is someone else, or says it is a wrong number."
}
},
{
"id": "e3",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "slot_booked",
"condition": "The customer named a day for the service and you read it back."
}
},
{
"id": "e4",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "not_now",
"condition": "The customer does not want to book now, and you have asked once when to call back if they were busy."
}
}
]
}
'import requests
url = "https://sandbox.voice.miraiminds.co/v2/agents/{agent_id}/flow"
payload = {
"nodes": [
{
"id": "persona",
"type": "globalNode",
"data": {
"name": "Persona and rules",
"prompt": "You are Ashu, a service advisor at Mirai Motors.
Speak everyday Hindi in Devanagari; common English words such as service, slot and workshop are fine.
Say one or two short sentences, then listen.
Never promise a discount, a price or a pickup.
When the condition of one of your functions is met, call it at once without saying anything first."
}
},
{
"id": "identity",
"type": "startCall",
"data": {
"name": "Confirm the customer",
"greeting": "नमस्ते, मैं मिराई मोटर्स से आशु बोल रहा हूं. क्या मेरी बात {{name}} जी से हो रही है?",
"prompt": "You have asked whether you are speaking with {{name}}. Wait for the answer.
If they confirm, call confirmed_identity.
If it is someone else or a wrong number, call wrong_person.
Do not mention the car or the service before they confirm."
}
},
{
"id": "offer_slot",
"type": "agentNode",
"data": {
"name": "Book the service",
"prompt": "Tell them their {{vehicle}} is due for service on {{due_date}}, and ask which day they can bring it to the workshop.
When they name a day, read it back once and call slot_booked.
If they are busy, ask once when to call them back, then call not_now.
If they do not want to book at all, call not_now.",
"extraction_enabled": True,
"extraction_variables": [
{
"name": "preferred_day",
"type": "string",
"prompt": "The day the customer chose for the service, in their words, for example Saturday or 20 August."
},
{
"name": "callback_time",
"type": "string",
"prompt": "When the customer asked to be called back, in their words. Empty if they did not ask."
}
]
}
},
{
"id": "goodbye",
"type": "endCall",
"data": {
"name": "Close",
"prompt": "In one sentence, repeat what was agreed. Thank them and say goodbye. Do not ask anything else.",
"allow_interrupt": False
}
},
{
"id": "not_customer",
"type": "endCall",
"data": {
"name": "Wrong person",
"prompt": "Apologise for the trouble and say goodbye. Do not mention the car or the service."
}
}
],
"edges": [
{
"id": "e1",
"source": "identity",
"target": "offer_slot",
"data": {
"label": "confirmed_identity",
"condition": "The caller confirmed they are the customer you asked for."
}
},
{
"id": "e2",
"source": "identity",
"target": "not_customer",
"data": {
"label": "wrong_person",
"condition": "The caller is someone else, or says it is a wrong number."
}
},
{
"id": "e3",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "slot_booked",
"condition": "The customer named a day for the service and you read it back."
}
},
{
"id": "e4",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "not_now",
"condition": "The customer does not want to book now, and you have asked once when to call back if they were busy."
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const url = 'https://sandbox.voice.miraiminds.co/v2/agents/{agent_id}/flow';
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
nodes: [
{
id: 'persona',
type: 'globalNode',
data: {
name: 'Persona and rules',
prompt: 'You are Ashu, a service advisor at Mirai Motors.\nSpeak everyday Hindi in Devanagari; common English words such as service, slot and workshop are fine.\nSay one or two short sentences, then listen.\nNever promise a discount, a price or a pickup.\nWhen the condition of one of your functions is met, call it at once without saying anything first.'
}
},
{
id: 'identity',
type: 'startCall',
data: {
name: 'Confirm the customer',
greeting: 'नमस्ते, मैं मिराई मोटर्स से आशु बोल रहा हूं. क्या मेरी बात {{name}} जी से हो रही है?',
prompt: 'You have asked whether you are speaking with {{name}}. Wait for the answer.\nIf they confirm, call confirmed_identity.\nIf it is someone else or a wrong number, call wrong_person.\nDo not mention the car or the service before they confirm.'
}
},
{
id: 'offer_slot',
type: 'agentNode',
data: {
name: 'Book the service',
prompt: 'Tell them their {{vehicle}} is due for service on {{due_date}}, and ask which day they can bring it to the workshop.\nWhen they name a day, read it back once and call slot_booked.\nIf they are busy, ask once when to call them back, then call not_now.\nIf they do not want to book at all, call not_now.',
extraction_enabled: true,
extraction_variables: [
{
name: 'preferred_day',
type: 'string',
prompt: 'The day the customer chose for the service, in their words, for example Saturday or 20 August.'
},
{
name: 'callback_time',
type: 'string',
prompt: 'When the customer asked to be called back, in their words. Empty if they did not ask.'
}
]
}
},
{
id: 'goodbye',
type: 'endCall',
data: {
name: 'Close',
prompt: 'In one sentence, repeat what was agreed. Thank them and say goodbye. Do not ask anything else.',
allow_interrupt: false
}
},
{
id: 'not_customer',
type: 'endCall',
data: {
name: 'Wrong person',
prompt: 'Apologise for the trouble and say goodbye. Do not mention the car or the service.'
}
}
],
edges: [
{
id: 'e1',
source: 'identity',
target: 'offer_slot',
data: {
label: 'confirmed_identity',
condition: 'The caller confirmed they are the customer you asked for.'
}
},
{
id: 'e2',
source: 'identity',
target: 'not_customer',
data: {
label: 'wrong_person',
condition: 'The caller is someone else, or says it is a wrong number.'
}
},
{
id: 'e3',
source: 'offer_slot',
target: 'goodbye',
data: {
label: 'slot_booked',
condition: 'The customer named a day for the service and you read it back.'
}
},
{
id: 'e4',
source: 'offer_slot',
target: 'goodbye',
data: {
label: 'not_now',
condition: 'The customer does not want to book now, and you have asked once when to call back if they were busy.'
}
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"revision": 5,
"draft": false,
"archived": false,
"analysis": {
"enabled": false
},
"id": "agt_01K2M4P7QRSTVWXYZ0A1B2C3",
"object": "agent",
"name": "सर्विस रिमाइंडर",
"system_prompt": "आप आशु हैं, मिराई मोटर्स के सर्विस एडवाइज़र. {{name}} जी की {{vehicle}} की सर्विस {{due_date}} को ड्यू है. हिंदी में बात करें, छोटे वाक्य बोलें, और ग्राहक से सर्विस की तारीख कन्फर्म करें.",
"first_message": "नमस्ते, मैं आशु बोल रहा हूं मिराई मोटर्स से. एक मिनट है आपके पास?",
"voice": {
"voice_id": "ashu",
"language": "hi"
},
"language": "hi",
"max_duration_secs": 300,
"end_call": {
"enabled": true,
"message": "धन्यवाद, आपका दिन शुभ हो.",
"confirm": true
},
"voicemail": {
"action": "hangup"
},
"background_sound": {
"sound": "off"
},
"behavior": {
"interruptions": "normal",
"adaptive_interruptions": true
},
"secondary_languages": [
"en"
],
"tools": [],
"flow": {
"nodes": [
{
"id": "persona",
"type": "globalNode",
"data": {
"name": "Persona and rules",
"prompt": "You are Ashu, a service advisor at Mirai Motors.\nSpeak everyday Hindi in Devanagari; common English words such as service, slot and workshop are fine.\nSay one or two short sentences, then listen.\nNever promise a discount, a price or a pickup.\nWhen the condition of one of your functions is met, call it at once without saying anything first.",
"is_start": false,
"allow_interrupt": true,
"add_global_prompt": true,
"extraction_enabled": false,
"extraction_variables": []
}
},
{
"id": "identity",
"type": "startCall",
"data": {
"name": "Confirm the customer",
"prompt": "You have asked whether you are speaking with {{name}}. Wait for the answer.\nIf they confirm, call confirmed_identity.\nIf it is someone else or a wrong number, call wrong_person.\nDo not mention the car or the service before they confirm.",
"greeting": "नमस्ते, मैं मिराई मोटर्स से आशु बोल रहा हूं. क्या मेरी बात {{name}} जी से हो रही है?",
"is_start": true,
"allow_interrupt": true,
"add_global_prompt": true,
"extraction_enabled": false,
"extraction_variables": []
}
},
{
"id": "offer_slot",
"type": "agentNode",
"data": {
"name": "Book the service",
"prompt": "Tell them their {{vehicle}} is due for service on {{due_date}}, and ask which day they can bring it to the workshop.\nWhen they name a day, read it back once and call slot_booked.\nIf they are busy, ask once when to call them back, then call not_now.\nIf they do not want to book at all, call not_now.",
"is_start": false,
"allow_interrupt": true,
"add_global_prompt": true,
"extraction_enabled": true,
"extraction_variables": [
{
"name": "preferred_day",
"type": "string",
"prompt": "The day the customer chose for the service, in their words, for example Saturday or 20 August."
},
{
"name": "callback_time",
"type": "string",
"prompt": "When the customer asked to be called back, in their words. Empty if they did not ask."
}
]
}
},
{
"id": "goodbye",
"type": "endCall",
"data": {
"name": "Close",
"prompt": "In one sentence, repeat what was agreed. Thank them and say goodbye. Do not ask anything else.",
"is_start": false,
"allow_interrupt": false,
"add_global_prompt": true,
"extraction_enabled": false,
"extraction_variables": []
}
},
{
"id": "not_customer",
"type": "endCall",
"data": {
"name": "Wrong person",
"prompt": "Apologise for the trouble and say goodbye. Do not mention the car or the service.",
"is_start": false,
"allow_interrupt": true,
"add_global_prompt": true,
"extraction_enabled": false,
"extraction_variables": []
}
}
],
"edges": [
{
"id": "e1",
"source": "identity",
"target": "offer_slot",
"data": {
"label": "confirmed_identity",
"condition": "The caller confirmed they are the customer you asked for."
}
},
{
"id": "e2",
"source": "identity",
"target": "not_customer",
"data": {
"label": "wrong_person",
"condition": "The caller is someone else, or says it is a wrong number."
}
},
{
"id": "e3",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "slot_booked",
"condition": "The customer named a day for the service and you read it back."
}
},
{
"id": "e4",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "not_now",
"condition": "The customer does not want to book now, and you have asked once when to call back if they were busy."
}
}
]
},
"created_at": "2026-08-11T09:14:02Z",
"updated_at": "2026-08-11T09:56:02Z"
}{
"details": [
{
"path": "flow.nodes[2].data.tools[0]",
"message": "node \"offer_slot\" offers tool \"check_slots\", which is not an on_call tool of this agent; add it with phase on_call or remove it from the node"
}
],
"error": "invalid_flow"
}{
"error": {
"code": "conflict",
"message": "agent changed; read its current revision and retry"
}
}Save a flow on an agent
Replaces the agent’s graph without resending the rest of the agent. It also turns a single-prompt agent into a node-based one. The body is the graph: here, the one the test above fixed.
Each save is a new agent revision, so you can roll it back. if_revision refuses the save if the agent changed since you read it; this collection keeps it up to date from the last agent response. Problems come back as invalid_flow with their paths, including node tools that are not on_call tools of this agent. The new graph applies from the next call.
curl --request PUT \
--url https://sandbox.voice.miraiminds.co/v2/agents/{agent_id}/flow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"nodes": [
{
"id": "persona",
"type": "globalNode",
"data": {
"name": "Persona and rules",
"prompt": "You are Ashu, a service advisor at Mirai Motors.\nSpeak everyday Hindi in Devanagari; common English words such as service, slot and workshop are fine.\nSay one or two short sentences, then listen.\nNever promise a discount, a price or a pickup.\nWhen the condition of one of your functions is met, call it at once without saying anything first."
}
},
{
"id": "identity",
"type": "startCall",
"data": {
"name": "Confirm the customer",
"greeting": "नमस्ते, मैं मिराई मोटर्स से आशु बोल रहा हूं. क्या मेरी बात {{name}} जी से हो रही है?",
"prompt": "You have asked whether you are speaking with {{name}}. Wait for the answer.\nIf they confirm, call confirmed_identity.\nIf it is someone else or a wrong number, call wrong_person.\nDo not mention the car or the service before they confirm."
}
},
{
"id": "offer_slot",
"type": "agentNode",
"data": {
"name": "Book the service",
"prompt": "Tell them their {{vehicle}} is due for service on {{due_date}}, and ask which day they can bring it to the workshop.\nWhen they name a day, read it back once and call slot_booked.\nIf they are busy, ask once when to call them back, then call not_now.\nIf they do not want to book at all, call not_now.",
"extraction_enabled": true,
"extraction_variables": [
{
"name": "preferred_day",
"type": "string",
"prompt": "The day the customer chose for the service, in their words, for example Saturday or 20 August."
},
{
"name": "callback_time",
"type": "string",
"prompt": "When the customer asked to be called back, in their words. Empty if they did not ask."
}
]
}
},
{
"id": "goodbye",
"type": "endCall",
"data": {
"name": "Close",
"prompt": "In one sentence, repeat what was agreed. Thank them and say goodbye. Do not ask anything else.",
"allow_interrupt": false
}
},
{
"id": "not_customer",
"type": "endCall",
"data": {
"name": "Wrong person",
"prompt": "Apologise for the trouble and say goodbye. Do not mention the car or the service."
}
}
],
"edges": [
{
"id": "e1",
"source": "identity",
"target": "offer_slot",
"data": {
"label": "confirmed_identity",
"condition": "The caller confirmed they are the customer you asked for."
}
},
{
"id": "e2",
"source": "identity",
"target": "not_customer",
"data": {
"label": "wrong_person",
"condition": "The caller is someone else, or says it is a wrong number."
}
},
{
"id": "e3",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "slot_booked",
"condition": "The customer named a day for the service and you read it back."
}
},
{
"id": "e4",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "not_now",
"condition": "The customer does not want to book now, and you have asked once when to call back if they were busy."
}
}
]
}
'import requests
url = "https://sandbox.voice.miraiminds.co/v2/agents/{agent_id}/flow"
payload = {
"nodes": [
{
"id": "persona",
"type": "globalNode",
"data": {
"name": "Persona and rules",
"prompt": "You are Ashu, a service advisor at Mirai Motors.
Speak everyday Hindi in Devanagari; common English words such as service, slot and workshop are fine.
Say one or two short sentences, then listen.
Never promise a discount, a price or a pickup.
When the condition of one of your functions is met, call it at once without saying anything first."
}
},
{
"id": "identity",
"type": "startCall",
"data": {
"name": "Confirm the customer",
"greeting": "नमस्ते, मैं मिराई मोटर्स से आशु बोल रहा हूं. क्या मेरी बात {{name}} जी से हो रही है?",
"prompt": "You have asked whether you are speaking with {{name}}. Wait for the answer.
If they confirm, call confirmed_identity.
If it is someone else or a wrong number, call wrong_person.
Do not mention the car or the service before they confirm."
}
},
{
"id": "offer_slot",
"type": "agentNode",
"data": {
"name": "Book the service",
"prompt": "Tell them their {{vehicle}} is due for service on {{due_date}}, and ask which day they can bring it to the workshop.
When they name a day, read it back once and call slot_booked.
If they are busy, ask once when to call them back, then call not_now.
If they do not want to book at all, call not_now.",
"extraction_enabled": True,
"extraction_variables": [
{
"name": "preferred_day",
"type": "string",
"prompt": "The day the customer chose for the service, in their words, for example Saturday or 20 August."
},
{
"name": "callback_time",
"type": "string",
"prompt": "When the customer asked to be called back, in their words. Empty if they did not ask."
}
]
}
},
{
"id": "goodbye",
"type": "endCall",
"data": {
"name": "Close",
"prompt": "In one sentence, repeat what was agreed. Thank them and say goodbye. Do not ask anything else.",
"allow_interrupt": False
}
},
{
"id": "not_customer",
"type": "endCall",
"data": {
"name": "Wrong person",
"prompt": "Apologise for the trouble and say goodbye. Do not mention the car or the service."
}
}
],
"edges": [
{
"id": "e1",
"source": "identity",
"target": "offer_slot",
"data": {
"label": "confirmed_identity",
"condition": "The caller confirmed they are the customer you asked for."
}
},
{
"id": "e2",
"source": "identity",
"target": "not_customer",
"data": {
"label": "wrong_person",
"condition": "The caller is someone else, or says it is a wrong number."
}
},
{
"id": "e3",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "slot_booked",
"condition": "The customer named a day for the service and you read it back."
}
},
{
"id": "e4",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "not_now",
"condition": "The customer does not want to book now, and you have asked once when to call back if they were busy."
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const url = 'https://sandbox.voice.miraiminds.co/v2/agents/{agent_id}/flow';
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
nodes: [
{
id: 'persona',
type: 'globalNode',
data: {
name: 'Persona and rules',
prompt: 'You are Ashu, a service advisor at Mirai Motors.\nSpeak everyday Hindi in Devanagari; common English words such as service, slot and workshop are fine.\nSay one or two short sentences, then listen.\nNever promise a discount, a price or a pickup.\nWhen the condition of one of your functions is met, call it at once without saying anything first.'
}
},
{
id: 'identity',
type: 'startCall',
data: {
name: 'Confirm the customer',
greeting: 'नमस्ते, मैं मिराई मोटर्स से आशु बोल रहा हूं. क्या मेरी बात {{name}} जी से हो रही है?',
prompt: 'You have asked whether you are speaking with {{name}}. Wait for the answer.\nIf they confirm, call confirmed_identity.\nIf it is someone else or a wrong number, call wrong_person.\nDo not mention the car or the service before they confirm.'
}
},
{
id: 'offer_slot',
type: 'agentNode',
data: {
name: 'Book the service',
prompt: 'Tell them their {{vehicle}} is due for service on {{due_date}}, and ask which day they can bring it to the workshop.\nWhen they name a day, read it back once and call slot_booked.\nIf they are busy, ask once when to call them back, then call not_now.\nIf they do not want to book at all, call not_now.',
extraction_enabled: true,
extraction_variables: [
{
name: 'preferred_day',
type: 'string',
prompt: 'The day the customer chose for the service, in their words, for example Saturday or 20 August.'
},
{
name: 'callback_time',
type: 'string',
prompt: 'When the customer asked to be called back, in their words. Empty if they did not ask.'
}
]
}
},
{
id: 'goodbye',
type: 'endCall',
data: {
name: 'Close',
prompt: 'In one sentence, repeat what was agreed. Thank them and say goodbye. Do not ask anything else.',
allow_interrupt: false
}
},
{
id: 'not_customer',
type: 'endCall',
data: {
name: 'Wrong person',
prompt: 'Apologise for the trouble and say goodbye. Do not mention the car or the service.'
}
}
],
edges: [
{
id: 'e1',
source: 'identity',
target: 'offer_slot',
data: {
label: 'confirmed_identity',
condition: 'The caller confirmed they are the customer you asked for.'
}
},
{
id: 'e2',
source: 'identity',
target: 'not_customer',
data: {
label: 'wrong_person',
condition: 'The caller is someone else, or says it is a wrong number.'
}
},
{
id: 'e3',
source: 'offer_slot',
target: 'goodbye',
data: {
label: 'slot_booked',
condition: 'The customer named a day for the service and you read it back.'
}
},
{
id: 'e4',
source: 'offer_slot',
target: 'goodbye',
data: {
label: 'not_now',
condition: 'The customer does not want to book now, and you have asked once when to call back if they were busy.'
}
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"revision": 5,
"draft": false,
"archived": false,
"analysis": {
"enabled": false
},
"id": "agt_01K2M4P7QRSTVWXYZ0A1B2C3",
"object": "agent",
"name": "सर्विस रिमाइंडर",
"system_prompt": "आप आशु हैं, मिराई मोटर्स के सर्विस एडवाइज़र. {{name}} जी की {{vehicle}} की सर्विस {{due_date}} को ड्यू है. हिंदी में बात करें, छोटे वाक्य बोलें, और ग्राहक से सर्विस की तारीख कन्फर्म करें.",
"first_message": "नमस्ते, मैं आशु बोल रहा हूं मिराई मोटर्स से. एक मिनट है आपके पास?",
"voice": {
"voice_id": "ashu",
"language": "hi"
},
"language": "hi",
"max_duration_secs": 300,
"end_call": {
"enabled": true,
"message": "धन्यवाद, आपका दिन शुभ हो.",
"confirm": true
},
"voicemail": {
"action": "hangup"
},
"background_sound": {
"sound": "off"
},
"behavior": {
"interruptions": "normal",
"adaptive_interruptions": true
},
"secondary_languages": [
"en"
],
"tools": [],
"flow": {
"nodes": [
{
"id": "persona",
"type": "globalNode",
"data": {
"name": "Persona and rules",
"prompt": "You are Ashu, a service advisor at Mirai Motors.\nSpeak everyday Hindi in Devanagari; common English words such as service, slot and workshop are fine.\nSay one or two short sentences, then listen.\nNever promise a discount, a price or a pickup.\nWhen the condition of one of your functions is met, call it at once without saying anything first.",
"is_start": false,
"allow_interrupt": true,
"add_global_prompt": true,
"extraction_enabled": false,
"extraction_variables": []
}
},
{
"id": "identity",
"type": "startCall",
"data": {
"name": "Confirm the customer",
"prompt": "You have asked whether you are speaking with {{name}}. Wait for the answer.\nIf they confirm, call confirmed_identity.\nIf it is someone else or a wrong number, call wrong_person.\nDo not mention the car or the service before they confirm.",
"greeting": "नमस्ते, मैं मिराई मोटर्स से आशु बोल रहा हूं. क्या मेरी बात {{name}} जी से हो रही है?",
"is_start": true,
"allow_interrupt": true,
"add_global_prompt": true,
"extraction_enabled": false,
"extraction_variables": []
}
},
{
"id": "offer_slot",
"type": "agentNode",
"data": {
"name": "Book the service",
"prompt": "Tell them their {{vehicle}} is due for service on {{due_date}}, and ask which day they can bring it to the workshop.\nWhen they name a day, read it back once and call slot_booked.\nIf they are busy, ask once when to call them back, then call not_now.\nIf they do not want to book at all, call not_now.",
"is_start": false,
"allow_interrupt": true,
"add_global_prompt": true,
"extraction_enabled": true,
"extraction_variables": [
{
"name": "preferred_day",
"type": "string",
"prompt": "The day the customer chose for the service, in their words, for example Saturday or 20 August."
},
{
"name": "callback_time",
"type": "string",
"prompt": "When the customer asked to be called back, in their words. Empty if they did not ask."
}
]
}
},
{
"id": "goodbye",
"type": "endCall",
"data": {
"name": "Close",
"prompt": "In one sentence, repeat what was agreed. Thank them and say goodbye. Do not ask anything else.",
"is_start": false,
"allow_interrupt": false,
"add_global_prompt": true,
"extraction_enabled": false,
"extraction_variables": []
}
},
{
"id": "not_customer",
"type": "endCall",
"data": {
"name": "Wrong person",
"prompt": "Apologise for the trouble and say goodbye. Do not mention the car or the service.",
"is_start": false,
"allow_interrupt": true,
"add_global_prompt": true,
"extraction_enabled": false,
"extraction_variables": []
}
}
],
"edges": [
{
"id": "e1",
"source": "identity",
"target": "offer_slot",
"data": {
"label": "confirmed_identity",
"condition": "The caller confirmed they are the customer you asked for."
}
},
{
"id": "e2",
"source": "identity",
"target": "not_customer",
"data": {
"label": "wrong_person",
"condition": "The caller is someone else, or says it is a wrong number."
}
},
{
"id": "e3",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "slot_booked",
"condition": "The customer named a day for the service and you read it back."
}
},
{
"id": "e4",
"source": "offer_slot",
"target": "goodbye",
"data": {
"label": "not_now",
"condition": "The customer does not want to book now, and you have asked once when to call back if they were busy."
}
}
]
},
"created_at": "2026-08-11T09:14:02Z",
"updated_at": "2026-08-11T09:56:02Z"
}{
"details": [
{
"path": "flow.nodes[2].data.tools[0]",
"message": "node \"offer_slot\" offers tool \"check_slots\", which is not an on_call tool of this agent; add it with phase on_call or remove it from the node"
}
],
"error": "invalid_flow"
}{
"error": {
"code": "conflict",
"message": "agent changed; read its current revision and retry"
}
}Authorizations
Your workspace secret key, sk_live_ followed by 32 hex characters. Create one in the console under Developers.
Path Parameters
The agent's id (agt_…).
Query Parameters
Optional. The agent revision you read.
Body
A node graph: the conversation as nodes with their own instructions and transitions between them. See x-semantics.flow for the rules.
Response
The agent, now node-based
How the agent takes turns with the caller. Always present; agents saved before this block existed read back with the defaults.
Show child attributes
Show child attributes
Other languages callers may speak. Speech recognition listens for them as well as the primary language. Optional; the primary language is never repeated here. Always returned; [] when there are none.
4hi, en, gu, mr, bn, ta, te, kn, ml, pa, od Replace the whole analysis block. Omit output_schema to remove structured extraction. Requires enabled=true to run.
Show child attributes
Show child attributes
Archive to block new calls; false restores availability subject to draft validation. Accepted call snapshots remain unchanged.
off, office The phone number this agent's outbound calls ring from when the call or its campaign does not choose one; null when unset (the Mirai shared line).
Show child attributes
Show child attributes
Drafts may have empty prompt or greeting, but cannot run calls.
Send call.processed when this agent has post-call tools, analysis or a flow (a flow agent's event carries the call's flow outcome). Set false to turn the event off.
Show child attributes
Show child attributes
500Present only on a flow agent.
Show child attributes
Show child attributes
Replace the entire input declaration. Null removes it and restores legacy string variables.
Show child attributes
Show child attributes
130 <= x <= 1800112000At most 40 tools: 10 pre_call, 20 on_call, 10 post_call. A PATCH replaces the whole list; null empties it. To edit one tool, use PUT/DELETE /v2/agents/{id}/tools/{name}.
40Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes