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"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/get-agent',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent_id: '550e8400-e29b-41d4-a716-446655440000'
}),
}
);
const agent = await response.json();
console.log('Agent:', agent.name);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/get-agent',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'agent_id': '550e8400-e29b-41d4-a716-446655440000'}
)
agent = response.json()
print(f"Agent: {agent['name']}")
{
"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"
}
]
}
Agents
Get Agent
Retrieve details of a specific AI agent
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"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/get-agent',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent_id: '550e8400-e29b-41d4-a716-446655440000'
}),
}
);
const agent = await response.json();
console.log('Agent:', agent.name);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/get-agent',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'agent_id': '550e8400-e29b-41d4-a716-446655440000'}
)
agent = response.json()
print(f"Agent: {agent['name']}")
{
"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
Response
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 assigned to this agent. Each entry has
id, phone_number, friendly_name, capabilities (voice, sms, mms), is_active, and created_at.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 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"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/get-agent',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent_id: '550e8400-e29b-41d4-a716-446655440000'
}),
}
);
const agent = await response.json();
console.log('Agent:', agent.name);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/get-agent',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'agent_id': '550e8400-e29b-41d4-a716-446655440000'}
)
agent = response.json()
print(f"Agent: {agent['name']}")
{
"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"
}
]
}