Skip to content

Update Contact

Partially updates information for an existing contact.

ParameterTypeRequiredDescription
idstringYesUnique ID of the contact to update

All fields are optional. Only sent fields will be updated.

{
"name": "John Carlos",
"lastName": "Doe Garcia",
"email": "[email protected]",
"phone": "3001234567",
"countryCode": "57",
"status": "INACTIVE",
"birthDate": "1990-01-15T00:00:00.000Z",
"tagIds": ["tag1-uuid", "tag2-uuid"],
"customValues": [
{
"id": "existing-value-uuid",
"value": "New value",
"customFieldId": "field-uuid"
}
]
}
FieldTypeDescription
namestringContact name
lastNamestringContact last name
emailstringEmail address
phonestringPhone number
countryCodestringCountry code
statusenumContact status: ACTIVE, INACTIVE, BLOCKED
birthDatedatetimeBirth date
tagIdsarrayTag IDs to associate
customValuesarrayCustom field values
{
"id": "contact-uuid-123",
"name": "John Carlos",
"lastName": "Doe Garcia",
"email": "[email protected]",
"phone": "3001234567",
"countryCode": "57",
"status": "INACTIVE",
"birthDate": "1990-01-15T00:00:00.000Z",
"origin": "API",
"organizationId": "org-uuid",
"customValues": [
{
"id": "existing-value-uuid",
"value": "New value",
"customFieldId": "field-uuid"
}
],
"tags": [
{
"id": "tag1-uuid",
"name": "VIP Client",
"description": "Important clients",
"color": "#FF5722"
}
],
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-15T14:30:00.000Z"
}
CodeDescription
400Invalid data in request
401Missing or invalid API Key
404Contact not found
409Phone number already exists
422Validation errors
500Internal server error
Ventana de terminal
curl -X PATCH "https://app.sendme123.com/api/contacts/contact-uuid-123" \
-H "api-key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"name": "John Carlos",
"email": "[email protected]",
"status": "INACTIVE"
}'
const deactivateContact = async (contactId) => {
try {
const response = await axios.patch(`https://app.sendme123.com/api/contacts/${contactId}`, {
status: 'INACTIVE'
}, {
headers: {
'api-key': 'your-api-key-here',
'Content-Type': 'application/json'
}
});
console.log('Contact deactivated:', response.data);
return response.data;
} catch (error) {
console.error('Error deactivating contact:', error.response?.data || error.message);
throw error;
}
};
const updateContactInfo = async (contactId, newInfo) => {
try {
const response = await axios.patch(`https://app.sendme123.com/api/contacts/${contactId}`, {
name: newInfo.name,
lastName: newInfo.lastName,
email: newInfo.email,
phone: newInfo.phone
}, {
headers: {
'api-key': 'your-api-key-here',
'Content-Type': 'application/json'
}
});
console.log('Contact information updated:', response.data);
return response.data;
} catch (error) {
console.error('Error updating contact info:', error.response?.data || error.message);
throw error;
}
};