curl -X POST https://api.magpipe.ai/functions/v1/update-agent \
-H "Authorization: Bearer mgp_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"greeting": "Hi there! Thanks for calling Acme Dental. How can I help you?",
"llm_model": "gpt-4.1"
}'
curl -X POST https://api.magpipe.ai/functions/v1/update-agent \
-H "Authorization: Bearer mgp_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"voice_id": "nPczCjzI2devNBz1zQrb"
}'
// Update greeting and model
const response = await fetch(
'https://api.magpipe.ai/functions/v1/update-agent',
{
method: 'POST',
headers: {
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent_id: '550e8400-e29b-41d4-a716-446655440000',
greeting: 'Hi there! Thanks for calling Acme Dental. How can I help you?',
llm_model: 'gpt-4.1',
}),
}
);
const agent = await response.json();
console.log('Updated:', agent.updated_at);
// Change voice to Brian
await fetch('https://api.magpipe.ai/functions/v1/update-agent', {
method: 'POST',
headers: {
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent_id: '550e8400-e29b-41d4-a716-446655440000',
voice_id: 'nPczCjzI2devNBz1zQrb',
}),
});
import requests
# Update greeting and model
response = requests.post(
'https://api.magpipe.ai/functions/v1/update-agent',
headers={
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
json={
'agent_id': '550e8400-e29b-41d4-a716-446655440000',
'greeting': 'Hi there! Thanks for calling Acme Dental. How can I help you?',
'llm_model': 'gpt-4.1',
}
)
print(f"Updated: {response.json()['updated_at']}")
# Change voice to Brian
requests.post(
'https://api.magpipe.ai/functions/v1/update-agent',
headers={
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
json={
'agent_id': '550e8400-e29b-41d4-a716-446655440000',
'voice_id': 'nPczCjzI2devNBz1zQrb',
}
)
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Sarah - Receptionist",
"greeting": "Hi there! Thanks for calling Acme Dental. How can I help you?",
"llm_model": "gpt-4o",
"updated_at": "2024-01-16T09:15:00Z",
"dynamic_variables": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "caller_name",
"description": "Full name of the caller",
"var_type": "text",
"enum_options": null,
"created_at": "2024-01-10T10:00:00Z",
"updated_at": "2024-01-10T10:00:00Z"
}
]
}
Agents
Update Agent
Update an existing AI agent’s configuration
POST
/
update-agent
curl -X POST https://api.magpipe.ai/functions/v1/update-agent \
-H "Authorization: Bearer mgp_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"greeting": "Hi there! Thanks for calling Acme Dental. How can I help you?",
"llm_model": "gpt-4.1"
}'
curl -X POST https://api.magpipe.ai/functions/v1/update-agent \
-H "Authorization: Bearer mgp_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"voice_id": "nPczCjzI2devNBz1zQrb"
}'
// Update greeting and model
const response = await fetch(
'https://api.magpipe.ai/functions/v1/update-agent',
{
method: 'POST',
headers: {
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent_id: '550e8400-e29b-41d4-a716-446655440000',
greeting: 'Hi there! Thanks for calling Acme Dental. How can I help you?',
llm_model: 'gpt-4.1',
}),
}
);
const agent = await response.json();
console.log('Updated:', agent.updated_at);
// Change voice to Brian
await fetch('https://api.magpipe.ai/functions/v1/update-agent', {
method: 'POST',
headers: {
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent_id: '550e8400-e29b-41d4-a716-446655440000',
voice_id: 'nPczCjzI2devNBz1zQrb',
}),
});
import requests
# Update greeting and model
response = requests.post(
'https://api.magpipe.ai/functions/v1/update-agent',
headers={
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
json={
'agent_id': '550e8400-e29b-41d4-a716-446655440000',
'greeting': 'Hi there! Thanks for calling Acme Dental. How can I help you?',
'llm_model': 'gpt-4.1',
}
)
print(f"Updated: {response.json()['updated_at']}")
# Change voice to Brian
requests.post(
'https://api.magpipe.ai/functions/v1/update-agent',
headers={
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
json={
'agent_id': '550e8400-e29b-41d4-a716-446655440000',
'voice_id': 'nPczCjzI2devNBz1zQrb',
}
)
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Sarah - Receptionist",
"greeting": "Hi there! Thanks for calling Acme Dental. How can I help you?",
"llm_model": "gpt-4o",
"updated_at": "2024-01-16T09:15:00Z",
"dynamic_variables": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "caller_name",
"description": "Full name of the caller",
"var_type": "text",
"enum_options": null,
"created_at": "2024-01-10T10:00:00Z",
"updated_at": "2024-01-10T10:00:00Z"
}
]
}
Update any configuration fields for an existing AI agent. Only include fields you want to change.
Request Body
string
required
The unique identifier of the agent to update.
string
Agent display name (max 100 characters).
string
Message spoken when answering calls (max 500 characters).
string
Instructions defining the agent’s behavior (max 10,000 characters).
string
Voice for phone calls. Use the List Voices endpoint to get all available options, including any cloned voices on your account.ElevenLabs voices:
OpenAI voices (prefix
| Voice ID | Name | Description |
|---|---|---|
EXAVITQu4vr4xnSDxMaL | Sarah | Professional, American female |
MF3mGyEYCl7XYWbV9V6O | Elli | Youthful, American female |
TxGEqnHWrfWFTfGW9XjX | Josh | Strong, American male |
pFZP5JQG7iQjIQuC4Bku | Lily | Confident, British female |
nPczCjzI2devNBz1zQrb | Brian | Classy, American male |
onwK4e9ZLuTAKqWW03F9 | Daniel | Formal, British male |
cjVigY5qzO86Huf0OWal | Eric | Friendly, American male |
cgSgspJ2msm6clMCkdW9 | Jessica | Expressive, American female |
XrExE9yKIg1WjnnlVkGX | Matilda | Upbeat, American female |
CwhRBWXzGAHq8TQ4Fs17 | Roger | Classy, American male |
FGY2WhTYpPnrIDTdsKH5 | Laura | Sassy, American female |
IKne3meq5aSn9XLyUdCD | Charlie | Hyped, Australian male |
JBFqnCBsd6RMkjVDRZzb | George | Mature, British male |
N2lVS1w4EtoT3dr4eOWO | Callum | Husky, American male |
SAz9YHcvj6GT2YYXdXww | River | Calm, neutral American |
SOYHLrjzK2X1ezoPC6cr | Harry | Rough, American male |
TX3LPaxmHKxFdv7VOQHJ | Liam | Confident, American male |
Xb7hH8MSUJpSbSDYk0k2 | Alice | Professional, British female |
bIHbv24MWmeRgasZH58o | Will | Chill, American male |
hpp4J3VqNfWAUOO0d1Us | Bella | Professional, American female |
iP95p4xoKVk53GoZ742B | Chris | Casual, American male |
pNInz6obpgDQGcFmaJgB | Adam | Deep, American male |
pqHfZKP75CvOlQylNhV4 | Bill | Trustworthy, American male |
openai-):| Voice ID | Name | Description |
|---|---|---|
openai-alloy | Alloy | Neutral, professional |
openai-echo | Echo | Warm, friendly |
openai-fable | Fable | Expressive, dynamic |
openai-nova | Nova | Bright, energetic |
openai-onyx | Onyx | Deep, authoritative |
openai-shimmer | Shimmer | Soft, calm |
string
LLM model for conversation.
| Model ID | Description |
|---|---|
gpt-4.1 | Recommended — best balance of speed and quality (default) |
gpt-4.1-mini | Fast and cost-effective |
gpt-4o-mini | Fast and cost-effective |
gpt-4o | Most capable, higher latency |
string
Language code (e.g.,
en-US, es-ES).integer
Maximum call duration in seconds (60 to 3600).
array
Phrases that trigger call termination.
string
Phone number for call transfers.
boolean
Enable or disable the agent.
object
Configuration for agent functions. See Create Agent for full schema.Example - Enable transfer with multiple numbers:Example - Configure end call:
{
"transfer": {
"enabled": true,
"numbers": [
{ "number": "+14155551234", "label": "Sales", "description": "Transfer for sales inquiries" }
]
}
}
{
"end_call": {
"enabled": true,
"description": "End the call after confirming the appointment."
}
}
array
Dynamic variables for extracting structured data from conversations. Replaces all existing variables for this agent.Each variable object:
name(string, required) — Variable name (e.g.,caller_name)description(string) — What to extractvar_type(string) —text(default),number,boolean, orenumenum_options(array) — Required whenvar_typeisenum
[
{"name": "caller_name", "description": "Full name of the caller", "var_type": "text"},
{"name": "priority", "description": "Call priority level", "var_type": "enum", "enum_options": ["low", "medium", "high"]}
]
boolean
Enable caller memory — the agent remembers past conversations with each contact.
object
Configuration for caller memory. Only applies when
memory_enabled is true.| Property | Type | Default | Description |
|---|---|---|---|
include_summaries | boolean | true | Include AI-generated relationship summary in context |
max_history_calls | number | 5 | Number of recent calls to consider when building context |
include_key_topics | boolean | true | Include key topics in context |
include_preferences | boolean | true | Include caller preferences in context |
{
"include_summaries": true,
"max_history_calls": 10,
"include_key_topics": true,
"include_preferences": true
}
boolean
Enable semantic memory — the agent finds similar past conversations across all contacts using AI embeddings.
object
Configuration for semantic memory. Only applies when
semantic_memory_enabled is true.| Property | Type | Default | Description |
|---|---|---|---|
max_results | number | 3 | Number of similar conversations to include |
similarity_threshold | number | 0.75 | Minimum similarity score (0.6–0.85) |
include_other_callers | boolean | true | Include conversations from other contacts |
{
"max_results": 5,
"similarity_threshold": 0.75,
"include_other_callers": true
}
array
Array of agent UUIDs that share memory with this agent. Allows multiple agents to access the same contact memories.
["550e8400-e29b-41d4-a716-446655440001", "550e8400-e29b-41d4-a716-446655440002"]
boolean
Whether calls handled by this agent are recorded. Defaults to
true. Set to false to disable recording for all calls routed to this agent (both inbound and outbound).{ "agent_id": "550e8400-e29b-41d4-a716-446655440000", "recording_enabled": false }
Response
Returns the updated agent object.curl -X POST https://api.magpipe.ai/functions/v1/update-agent \
-H "Authorization: Bearer mgp_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"greeting": "Hi there! Thanks for calling Acme Dental. How can I help you?",
"llm_model": "gpt-4.1"
}'
curl -X POST https://api.magpipe.ai/functions/v1/update-agent \
-H "Authorization: Bearer mgp_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"voice_id": "nPczCjzI2devNBz1zQrb"
}'
// Update greeting and model
const response = await fetch(
'https://api.magpipe.ai/functions/v1/update-agent',
{
method: 'POST',
headers: {
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent_id: '550e8400-e29b-41d4-a716-446655440000',
greeting: 'Hi there! Thanks for calling Acme Dental. How can I help you?',
llm_model: 'gpt-4.1',
}),
}
);
const agent = await response.json();
console.log('Updated:', agent.updated_at);
// Change voice to Brian
await fetch('https://api.magpipe.ai/functions/v1/update-agent', {
method: 'POST',
headers: {
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent_id: '550e8400-e29b-41d4-a716-446655440000',
voice_id: 'nPczCjzI2devNBz1zQrb',
}),
});
import requests
# Update greeting and model
response = requests.post(
'https://api.magpipe.ai/functions/v1/update-agent',
headers={
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
json={
'agent_id': '550e8400-e29b-41d4-a716-446655440000',
'greeting': 'Hi there! Thanks for calling Acme Dental. How can I help you?',
'llm_model': 'gpt-4.1',
}
)
print(f"Updated: {response.json()['updated_at']}")
# Change voice to Brian
requests.post(
'https://api.magpipe.ai/functions/v1/update-agent',
headers={
'Authorization': 'Bearer mgp_your_api_key',
'Content-Type': 'application/json',
},
json={
'agent_id': '550e8400-e29b-41d4-a716-446655440000',
'voice_id': 'nPczCjzI2devNBz1zQrb',
}
)
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Sarah - Receptionist",
"greeting": "Hi there! Thanks for calling Acme Dental. How can I help you?",
"llm_model": "gpt-4o",
"updated_at": "2024-01-16T09:15:00Z",
"dynamic_variables": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "caller_name",
"description": "Full name of the caller",
"var_type": "text",
"enum_options": null,
"created_at": "2024-01-10T10:00:00Z",
"updated_at": "2024-01-10T10:00:00Z"
}
]
}