Update a contact
PATCH
/v1/contacts/{id}
This endpoint allows you to update an existing contact in your Protocol contact list. You can update any of the contact's attributes.
Optional attributes
username
•stringThe new username for the contact.
phone_number
•stringThe new phone number for the contact.
avatar_url
•stringThe new avatar image URL for the contact.
display_name
•stringThe new display name for the contact.
Request example
fetch('https://api.protocol.chat/v1/contacts/WAz8eIbvDR60rouK', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
display_name: 'John Smith',
phone_number: '+1 (555) 987-6543'
})
})
{
"id": "WAz8eIbvDR60rouK",
"username": "johndoe",
"phone_number": "+1 (555) 987-6543",
"avatar_url": "https://assets.protocol.chat/avatars/johndoe.jpg",
"display_name": "John Smith",
"updated_at": 692233200
}