Create or update a contact
upsert_contactCreates a contact, or updates the one that already exists for that phone number or BSUID (the business-scoped user id Meta sends; a contact may have one and no phone). On a contact that exists only the fields you send change, and nothing is removed: tags are added to its tags, attributes are merged into its attributes, changing the name needs an owner or admin, and profile_name is only filled when WhatsApp has not given one; a field sent as null is left as it is. Writes only to Cosend: it sends nothing and the contact is not notified. Who can be messaged stays the same: a send needs no opt-in, only an opt-out stops one, and opt-outs are recorded on their own ledger.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"connection_id": "<connection_id>"
},
"name": "upsert_contact"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| tags | No | A new contact gets these tags. A contact that already exists gets them added to its own, and keeps every tag it has. | |
| bsuid | No | ||
| locale | No | ||
| timezone | No | ||
| attributes | No | Free-form values. PATCH replaces them whole; a POST for a contact that already exists writes the keys sent over its values and removes none. A key registered in /v1/contact-fields must hold a value of its type (text: a string; number: a number; date: YYYY-MM-DD; boolean: true or false; choice: one of its choices) or null; after a PATCH that sets attributes, or a POST that writes them to a contact that already exists, every required field must have a value. A key that is not registered is kept as it comes. | |
| phone_e164 | No | ||
| profile_name | No | ||
| connection_id | Yes |