Skip to main content
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"
  }'
{
  "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

agent_id
string
required
The unique identifier of the agent to update.
name
string
Agent display name (max 100 characters).
greeting
string
Message spoken when answering calls (max 500 characters).
system_prompt
string
Instructions defining the agent’s behavior (max 10,000 characters).
voice_id
string
Voice for phone calls. Use the List Voices endpoint to get all available options, including any cloned voices on your account.ElevenLabs voices:
Voice IDNameDescription
EXAVITQu4vr4xnSDxMaLSarahProfessional, American female
MF3mGyEYCl7XYWbV9V6OElliYouthful, American female
TxGEqnHWrfWFTfGW9XjXJoshStrong, American male
pFZP5JQG7iQjIQuC4BkuLilyConfident, British female
nPczCjzI2devNBz1zQrbBrianClassy, American male
onwK4e9ZLuTAKqWW03F9DanielFormal, British male
cjVigY5qzO86Huf0OWalEricFriendly, American male
cgSgspJ2msm6clMCkdW9JessicaExpressive, American female
XrExE9yKIg1WjnnlVkGXMatildaUpbeat, American female
CwhRBWXzGAHq8TQ4Fs17RogerClassy, American male
FGY2WhTYpPnrIDTdsKH5LauraSassy, American female
IKne3meq5aSn9XLyUdCDCharlieHyped, Australian male
JBFqnCBsd6RMkjVDRZzbGeorgeMature, British male
N2lVS1w4EtoT3dr4eOWOCallumHusky, American male
SAz9YHcvj6GT2YYXdXwwRiverCalm, neutral American
SOYHLrjzK2X1ezoPC6crHarryRough, American male
TX3LPaxmHKxFdv7VOQHJLiamConfident, American male
Xb7hH8MSUJpSbSDYk0k2AliceProfessional, British female
bIHbv24MWmeRgasZH58oWillChill, American male
hpp4J3VqNfWAUOO0d1UsBellaProfessional, American female
iP95p4xoKVk53GoZ742BChrisCasual, American male
pNInz6obpgDQGcFmaJgBAdamDeep, American male
pqHfZKP75CvOlQylNhV4BillTrustworthy, American male
OpenAI voices (prefix openai-):
Voice IDNameDescription
openai-alloyAlloyNeutral, professional
openai-echoEchoWarm, friendly
openai-fableFableExpressive, dynamic
openai-novaNovaBright, energetic
openai-onyxOnyxDeep, authoritative
openai-shimmerShimmerSoft, calm
llm_model
string
LLM model for conversation.
Model IDDescription
gpt-4.1Recommended — best balance of speed and quality (default)
gpt-4.1-miniFast and cost-effective
gpt-4o-miniFast and cost-effective
gpt-4oMost capable, higher latency
language
string
Language code (e.g., en-US, es-ES).
max_call_duration
integer
Maximum call duration in seconds (60 to 3600).
end_call_phrases
array
Phrases that trigger call termination.
transfer_phone_number
string
Phone number for call transfers.
is_active
boolean
Enable or disable the agent.
functions
object
Configuration for agent functions. See Create Agent for full schema.Example - Enable transfer with multiple numbers:
{
  "transfer": {
    "enabled": true,
    "numbers": [
      { "number": "+14155551234", "label": "Sales", "description": "Transfer for sales inquiries" }
    ]
  }
}
Example - Configure end call:
{
  "end_call": {
    "enabled": true,
    "description": "End the call after confirming the appointment."
  }
}
dynamic_variables
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 extract
  • var_type (string) — text (default), number, boolean, or enum
  • enum_options (array) — Required when var_type is enum
[
  {"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"]}
]
memory_enabled
boolean
Enable caller memory — the agent remembers past conversations with each contact.
memory_config
object
Configuration for caller memory. Only applies when memory_enabled is true.
PropertyTypeDefaultDescription
include_summariesbooleantrueInclude AI-generated relationship summary in context
max_history_callsnumber5Number of recent calls to consider when building context
include_key_topicsbooleantrueInclude key topics in context
include_preferencesbooleantrueInclude caller preferences in context
{
  "include_summaries": true,
  "max_history_calls": 10,
  "include_key_topics": true,
  "include_preferences": true
}
semantic_memory_enabled
boolean
Enable semantic memory — the agent finds similar past conversations across all contacts using AI embeddings.
semantic_memory_config
object
Configuration for semantic memory. Only applies when semantic_memory_enabled is true.
PropertyTypeDefaultDescription
max_resultsnumber3Number of similar conversations to include
similarity_thresholdnumber0.75Minimum similarity score (0.6–0.85)
include_other_callersbooleantrueInclude conversations from other contacts
{
  "max_results": 5,
  "similarity_threshold": 0.75,
  "include_other_callers": true
}
shared_memory_agent_ids
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"]
recording_enabled
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"
  }'
{
  "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"
    }
  ]
}