Assign Tags & Custom Fields
POSThttps://public.leadpattern.com/customer/assign-tags-custom-fields
Upsert a customer by phone and assign tags and/or custom field values. Creates the contact if they don't exist.
- Tags are matched by name and created on the fly when missing.
- Creates the contact if the phone is unknown.
Headers
1 fieldAuthorizationstringrequired
Your API key. Sent raw (e.g. 'lp_...'). No Bearer prefix required.
Body Parameters
5 fieldsphonestringrequired
Customer phone (with country code).
namestringoptional
Customer name to set.
optInbooleanoptional
Marketing opt-in flag.
tagsarray<string>optional
Tags to assign (created if missing).
customFieldsarray of objectsoptional
Custom field values (field must already exist).
namestringrequired
valuestringrequired
Responses
JSON Response
{
"type": "success",
"data": {
"customerId": "64a1bc...",
"tags": {
"added": [
"VIP",
"Renewal"
],
"errored": []
},
"customFields": {
"added": [
"Plan",
"Region"
],
"errored": []
}
}
}Sample Request Body
{
"phone": "+9195XXXXXXXX",
"name": "John Doe",
"optIn": true,
"tags": [
"VIP",
"Renewal"
],
"customFields": [
{
"name": "Plan",
"value": "Enterprise"
},
{
"name": "Region",
"value": "India"
}
]
}
