Upsert Contact
Catalog + Curated
This page is generated from the full broker catalog and enhanced with curated examples.
Create or update a contact idempotently.
Request Body
{
"jsonrpc": "2.0",
"id": "ghl-upsert-contact-example",
"method": "tools/call",
"params": {
"name": "ghl.upsert_contact",
"arguments": {
"firstName": "Ava",
"lastName": "Reed",
"email": "ava.reed@example.com",
"tags": [
"lead",
"vip"
]
}
}
}
Arguments Schema
{
"type": "object",
"required": [
"firstName"
],
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"email": {
"type": "string"
},
"phone": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
Code Examples
- cURL
- Node.js
- Python
curl -X POST 'https://madpanda3d.com/lab/mad-mcps/portal/api/mcp' \
-H 'Authorization: Bearer mad_live_***' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": "ghl-upsert-contact-example",
"method": "tools/call",
"params": {
"name": "ghl.upsert_contact",
"arguments": {
"firstName": "Ava",
"lastName": "Reed",
"email": "ava.reed@example.com",
"tags": [
"lead",
"vip"
]
}
}
}'
const response = await fetch('https://madpanda3d.com/lab/mad-mcps/portal/api/mcp', {
method: 'POST',
headers: {
Authorization: 'Bearer mad_live_***',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"jsonrpc": "2.0",
"id": "ghl-upsert-contact-example",
"method": "tools/call",
"params": {
"name": "ghl.upsert_contact",
"arguments": {
"firstName": "Ava",
"lastName": "Reed",
"email": "ava.reed@example.com",
"tags": [
"lead",
"vip"
]
}
}
}),
});
const data = await response.json();
console.log(data);
import requests
url = 'https://madpanda3d.com/lab/mad-mcps/portal/api/mcp'
headers = {
'Authorization': 'Bearer mad_live_***',
'Content-Type': 'application/json',
}
payload = {
"jsonrpc": "2.0",
"id": "ghl-upsert-contact-example",
"method": "tools/call",
"params": {
"name": "ghl.upsert_contact",
"arguments": {
"firstName": "Ava",
"lastName": "Reed",
"email": "ava.reed@example.com",
"tags": [
"lead",
"vip"
]
}
}
}
response = requests.post(url, headers=headers, json=payload, timeout=60)
print(response.json())
Example Responses
- 200 Success
- 400 Missing Required
{
"ok": true,
"contact": {
"id": "cont_294",
"firstName": "Ava",
"email": "ava.reed@example.com"
}
}
{
"ok": false,
"error": "validation_error",
"message": "firstName is required"
}