Update a contact in your directory
This endpoint will let you edit an existing contact in your 2Chat account using its UUID. You can get this data using the List Contacts endpoint, or the Search Endpoint.
Contact fields
Each contact must have at least a first name and some contact details like a phone number or an email address.
| Field | Description |
|---|---|
first_name | First name. |
last_name | Last name. |
profile_pic_url | A publicly accessible URL. |
channel_uuid | When provided, the contact will also be updated on your WhatsApp account. |
contact_details | You can find more information about contact details here. |
The channel_uuid parameter must a WhatsApp channel. If the contact already has an associated channel_uuid, it will update the contact on the corresponding WhatsApp account. If you are changing the channel_uuid to something else, it will create or update the contact on the newly associated WhatsApp account.
You can obtain a list of UUIDs using the list numbers endpoint.
Invocation
Make a PUT request to https://api.p.2chat.io/open/contacts/<contact-uuid>, where:
<contact-uuid> is the UUID of the contact you would like to update. E.g.: CON58147f7c-3756-4ca1-893c-c3360342b424.
Invocation
- cURL
- Python
- JavaScript
curl --location --request PUT 'https://api.p.2chat.io/open/contacts/CON58147f7c-3756-4ca1-893c-c3360342b424' \
--header 'Content-Type: application/json' \
--header 'X-User-API-Key: your_api_key_here' \
--data '{
"first_name": "Updated name",
"last_name": "Updated last name"
}'
import requests
import json
url = "https://api.p.2chat.io/open/contacts/CON58147f7c-3756-4ca1-893c-c3360342b424"
payload = json.dumps(
{
"first_name": "Updated name",
"last_name": "Updated last name"
}
)
headers = {
'X-User-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = JSON.stringify({
"first_name": "Updated name",
"last_name": "Updated last name"
});
var config = {
method: 'PUT',
url: 'https://api.p.2chat.io/open/contacts/CON58147f7c-3756-4ca1-893c-c3360342b424',
headers: {
'X-User-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Response
{
"success": true,
"contact": {
"uuid": "CON58147f7c-3756-4ca1-893c-c3360342b424",
"first_name": "Updated name",
"last_name": "Updated last name",
"channel_uuid": "WPN66037eca-9ad1-4c96-9eff-526a90a48c77",
"profile_pic_url": null,
"last_updated": "2025-12-03T00:29:08Z"
}
}