curl -X POST https://api.magpipe.ai/functions/v1/create-contact \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+14155551234",
"name": "John Smith",
"email": "john@example.com",
"company": "Acme Corp",
"tags": ["customer", "vip"]
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/create-contact',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone_number: '+14155551234',
name: 'John Smith',
email: 'john@example.com',
company: 'Acme Corp',
tags: ['customer', 'vip']
}),
}
);
const contact = await response.json();
console.log('Created:', contact.id);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/create-contact',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'phone_number': '+14155551234',
'name': 'John Smith',
'email': 'john@example.com',
'company': 'Acme Corp',
'tags': ['customer', 'vip']
}
)
contact = response.json()
print(f"Created: {contact['id']}")
{
"id": "c1d2e3f4-5678-9abc-def0-123456789abc",
"phone_number": "+14155551234",
"name": "John Smith",
"email": "john@example.com",
"company": "Acme Corp",
"notes": null,
"tags": ["customer", "vip"],
"metadata": {},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
{
"error": {
"code": "duplicate_contact",
"message": "A contact with this phone number already exists"
}
}
Contacts
Create Contact
Create a new contact in your address book
POST
/
create-contact
curl -X POST https://api.magpipe.ai/functions/v1/create-contact \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+14155551234",
"name": "John Smith",
"email": "john@example.com",
"company": "Acme Corp",
"tags": ["customer", "vip"]
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/create-contact',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone_number: '+14155551234',
name: 'John Smith',
email: 'john@example.com',
company: 'Acme Corp',
tags: ['customer', 'vip']
}),
}
);
const contact = await response.json();
console.log('Created:', contact.id);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/create-contact',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'phone_number': '+14155551234',
'name': 'John Smith',
'email': 'john@example.com',
'company': 'Acme Corp',
'tags': ['customer', 'vip']
}
)
contact = response.json()
print(f"Created: {contact['id']}")
{
"id": "c1d2e3f4-5678-9abc-def0-123456789abc",
"phone_number": "+14155551234",
"name": "John Smith",
"email": "john@example.com",
"company": "Acme Corp",
"notes": null,
"tags": ["customer", "vip"],
"metadata": {},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
{
"error": {
"code": "duplicate_contact",
"message": "A contact with this phone number already exists"
}
}
Create a new contact for managing caller information and conversation history.
Request Body
string
required
Contact’s phone number in E.164 format.Example:
+14155551234string
Contact’s full name.Example:
John Smithstring
Contact’s email address.Example:
john@example.comstring
Contact’s company or organization.Example:
Acme Corpstring
Internal notes about the contact.Example:
Prefers morning appointmentsarray
Array of tags for categorization.Example:
["customer", "vip"]object
Custom key-value pairs for your reference.
{
"customer_id": "cust_123",
"source": "website"
}
Response
Returns the created contact object.string
Unique contact identifier.
string
Contact’s phone number.
string
Contact’s name.
string
Contact’s email.
string
Contact’s company.
string
Internal notes.
array
Contact tags.
string
When the contact was created.
curl -X POST https://api.magpipe.ai/functions/v1/create-contact \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+14155551234",
"name": "John Smith",
"email": "john@example.com",
"company": "Acme Corp",
"tags": ["customer", "vip"]
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/create-contact',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone_number: '+14155551234',
name: 'John Smith',
email: 'john@example.com',
company: 'Acme Corp',
tags: ['customer', 'vip']
}),
}
);
const contact = await response.json();
console.log('Created:', contact.id);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/create-contact',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'phone_number': '+14155551234',
'name': 'John Smith',
'email': 'john@example.com',
'company': 'Acme Corp',
'tags': ['customer', 'vip']
}
)
contact = response.json()
print(f"Created: {contact['id']}")
{
"id": "c1d2e3f4-5678-9abc-def0-123456789abc",
"phone_number": "+14155551234",
"name": "John Smith",
"email": "john@example.com",
"company": "Acme Corp",
"notes": null,
"tags": ["customer", "vip"],
"metadata": {},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
{
"error": {
"code": "duplicate_contact",
"message": "A contact with this phone number already exists"
}
}
⌘I