Skip to main content
POST
/
get-agent
curl -X POST https://api.magpipe.ai/functions/v1/get-agent \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agent_id": "550e8400-e29b-41d4-a716-446655440000"}'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Sarah - Receptionist",
  "greeting": "Hello, thank you for calling Acme Dental. This is Sarah, how can I help you today?",
  "system_prompt": "You are Sarah, a friendly receptionist for Acme Dental Clinic...",
  "voice_id": "21m00Tcm4TlvDq8ikWAM",
  "llm_model": "gpt-4.1",
  "language": "en-US",
  "agent_type": "both",
  "max_call_duration": 1800,
  "end_call_phrases": ["goodbye", "have a nice day"],
  "transfer_number": "+16045559999",
  "organization_name": "Acme Dental",
  "owner_name": "Dr. Smith",
  "agent_role": "Receptionist",
  "is_active": true,
  "is_default": true,
  "created_at": "2024-01-10T10:00:00Z",
  "updated_at": "2024-01-15T14:30: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"
    }
  ],
  "phone_numbers": [
    {
      "id": "fea1d6c3-d686-4a1b-bfe6-2acbd30dd991",
      "phone_number": "+16045551234",
      "friendly_name": "Main Line",
      "capabilities": { "voice": true, "sms": true, "mms": false },
      "is_active": true,
      "created_at": "2024-01-10T10:00:00Z"
    }
  ],
  "custom_functions": [
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "check_availability",
      "description": "Check calendar availability",
      "http_method": "POST",
      "endpoint_url": "https://api.example.com/availability",
      "is_active": true,
      "created_at": "2024-01-10T10:00:00Z",
      "updated_at": "2024-01-10T10:00:00Z"
    }
  ],
  "knowledge_sources": [
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "title": "Company FAQ",
      "url": "https://example.com/faq",
      "sync_status": "completed",
      "chunk_count": 12,
      "last_synced_at": "2024-01-15T14:00:00Z",
      "created_at": "2024-01-10T10:00:00Z",
      "updated_at": "2024-01-15T14:00:00Z"
    }
  ]
}
Get the full configuration and details of an AI agent.

Request Body

agent_id
string
required
The unique identifier of the agent to retrieve.

Response

id
string
Unique agent identifier.
name
string
Agent display name.
greeting
string
Message spoken when answering calls.
system_prompt
string
Instructions defining the agent’s behavior and knowledge.
voice_id
string
Voice identifier for text-to-speech.
llm_model
string
LLM model for conversation. Default: gpt-4.1. Options: gpt-4.1, gpt-4o, gpt-4o-mini.
language
string
Agent language code (e.g., en-US).
agent_type
string
Agent type: inbound, outbound, or both.
max_call_duration
integer
Maximum call duration in seconds.
end_call_phrases
array
Phrases that trigger call termination.
transfer_number
string
Phone number for call transfers.
organization_name
string
Organization name for context.
owner_name
string
Owner name the agent represents.
agent_role
string
Agent’s role (e.g., “Receptionist”).
is_active
boolean
Whether the agent is enabled.
is_default
boolean
Whether this is the default agent.
created_at
string
When the agent was created.
updated_at
string
When the agent was last modified.
dynamic_variables
array
Dynamic variables configured for this agent. Each variable has id, name, description, var_type (text, number, boolean, enum), enum_options, created_at, and updated_at.
phone_numbers
array
Phone numbers assigned to this agent. Each entry has id, phone_number, friendly_name, capabilities (voice, sms, mms), is_active, and created_at.
custom_functions
array
Custom functions (tools) the agent can call during conversations. Each entry has id, name, description, http_method, endpoint_url, headers, query_params, body_schema, response_variables, timeout_ms, max_retries, is_active, created_at, and updated_at.
knowledge_sources
array
Knowledge base sources linked to this agent. Each entry has id, title, url, sync_status, chunk_count, last_synced_at, created_at, and updated_at.
curl -X POST https://api.magpipe.ai/functions/v1/get-agent \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agent_id": "550e8400-e29b-41d4-a716-446655440000"}'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Sarah - Receptionist",
  "greeting": "Hello, thank you for calling Acme Dental. This is Sarah, how can I help you today?",
  "system_prompt": "You are Sarah, a friendly receptionist for Acme Dental Clinic...",
  "voice_id": "21m00Tcm4TlvDq8ikWAM",
  "llm_model": "gpt-4.1",
  "language": "en-US",
  "agent_type": "both",
  "max_call_duration": 1800,
  "end_call_phrases": ["goodbye", "have a nice day"],
  "transfer_number": "+16045559999",
  "organization_name": "Acme Dental",
  "owner_name": "Dr. Smith",
  "agent_role": "Receptionist",
  "is_active": true,
  "is_default": true,
  "created_at": "2024-01-10T10:00:00Z",
  "updated_at": "2024-01-15T14:30: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"
    }
  ],
  "phone_numbers": [
    {
      "id": "fea1d6c3-d686-4a1b-bfe6-2acbd30dd991",
      "phone_number": "+16045551234",
      "friendly_name": "Main Line",
      "capabilities": { "voice": true, "sms": true, "mms": false },
      "is_active": true,
      "created_at": "2024-01-10T10:00:00Z"
    }
  ],
  "custom_functions": [
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "check_availability",
      "description": "Check calendar availability",
      "http_method": "POST",
      "endpoint_url": "https://api.example.com/availability",
      "is_active": true,
      "created_at": "2024-01-10T10:00:00Z",
      "updated_at": "2024-01-10T10:00:00Z"
    }
  ],
  "knowledge_sources": [
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "title": "Company FAQ",
      "url": "https://example.com/faq",
      "sync_status": "completed",
      "chunk_count": 12,
      "last_synced_at": "2024-01-15T14:00:00Z",
      "created_at": "2024-01-10T10:00:00Z",
      "updated_at": "2024-01-15T14:00:00Z"
    }
  ]
}