curl -X POST https://api.magpipe.ai/functions/v1/transfer-call \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"call_id": "7f3d8e00-a1b2-4c3d-9e4f-567890abcdef",
"transfer_to": "+14155559999",
"announce": "I am now transferring you to a specialist. Please hold."
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/transfer-call',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
call_id: '7f3d8e00-a1b2-4c3d-9e4f-567890abcdef',
transfer_to: '+14155559999',
announce: 'I am now transferring you to a specialist. Please hold.'
}),
}
);
const result = await response.json();
console.log('Transfer initiated:', result.success);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/transfer-call',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'call_id': '7f3d8e00-a1b2-4c3d-9e4f-567890abcdef',
'transfer_to': '+14155559999',
'announce': 'I am now transferring you to a specialist. Please hold.'
}
)
result = response.json()
print(f"Transfer initiated: {result['success']}")
{
"success": true,
"transfer_call_id": "8a4e9f00-b2c3-5d4e-0f1a-678901bcdef0"
}
{
"error": {
"code": "call_not_active",
"message": "The specified call is not currently active"
}
}
Calls
Transfer Call
Transfer an active call to another phone number
POST
/
transfer-call
curl -X POST https://api.magpipe.ai/functions/v1/transfer-call \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"call_id": "7f3d8e00-a1b2-4c3d-9e4f-567890abcdef",
"transfer_to": "+14155559999",
"announce": "I am now transferring you to a specialist. Please hold."
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/transfer-call',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
call_id: '7f3d8e00-a1b2-4c3d-9e4f-567890abcdef',
transfer_to: '+14155559999',
announce: 'I am now transferring you to a specialist. Please hold.'
}),
}
);
const result = await response.json();
console.log('Transfer initiated:', result.success);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/transfer-call',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'call_id': '7f3d8e00-a1b2-4c3d-9e4f-567890abcdef',
'transfer_to': '+14155559999',
'announce': 'I am now transferring you to a specialist. Please hold.'
}
)
result = response.json()
print(f"Transfer initiated: {result['success']}")
{
"success": true,
"transfer_call_id": "8a4e9f00-b2c3-5d4e-0f1a-678901bcdef0"
}
{
"error": {
"code": "call_not_active",
"message": "The specified call is not currently active"
}
}
Transfer an in-progress call to another phone number. The AI agent can announce the transfer before connecting the caller to the new number.
Request Body
string
required
The unique identifier of the active call to transfer.
string
required
The phone number to transfer the call to in E.164 format.
string
Message the AI agent will speak before transferring the call. If omitted, the call transfers immediately.
Response
boolean
Whether the transfer was initiated successfully.
string
Unique identifier for the transfer leg of the call.
curl -X POST https://api.magpipe.ai/functions/v1/transfer-call \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"call_id": "7f3d8e00-a1b2-4c3d-9e4f-567890abcdef",
"transfer_to": "+14155559999",
"announce": "I am now transferring you to a specialist. Please hold."
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/transfer-call',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
call_id: '7f3d8e00-a1b2-4c3d-9e4f-567890abcdef',
transfer_to: '+14155559999',
announce: 'I am now transferring you to a specialist. Please hold.'
}),
}
);
const result = await response.json();
console.log('Transfer initiated:', result.success);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/transfer-call',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'call_id': '7f3d8e00-a1b2-4c3d-9e4f-567890abcdef',
'transfer_to': '+14155559999',
'announce': 'I am now transferring you to a specialist. Please hold.'
}
)
result = response.json()
print(f"Transfer initiated: {result['success']}")
{
"success": true,
"transfer_call_id": "8a4e9f00-b2c3-5d4e-0f1a-678901bcdef0"
}
{
"error": {
"code": "call_not_active",
"message": "The specified call is not currently active"
}
}
⌘I