Update a customer
Update a customer's details in Proto from your own system.
Deprecated: v2 is an older version of this request. Use v3 for new integrations.
Updates a customer’s details from your own system – for example, when they update their email address in your CRM. Only the fields you send change, and everything else stays as it is. Not sure how to send a request? See Make your first request.
Request
Send a PATCH request to:
https://v3-api.proto.cx/api/platform/v1/customers/YOUR_TEAMSPACE_ID/update-customer/YOUR_CUSTOMER_ID/v3
Send a PUT request to:
https://v3-api.proto.cx/api/platform/v1/customers/YOUR_TEAMSPACE_ID/update-customer/YOUR_CUSTOMER_ID/v2
In the body, send only the fields that changed – every field is optional. In the address and the body, replace anything starting with YOUR_ with your own – YOUR_CUSTOMER_ID is your ID for the customer, the one you used when you created them:
{
"name": "Amara Okafor",
"email": "amara@okafor.example",
"phone_number": "+2348031234567",
"location": "Abuja, Nigeria",
"avatar": "https://example.com/amara.png",
"external_customer_id": "2348031234567",
"add_tags_ids": ["YOUR_TAG_ID"],
"remove_tags_ids": ["YOUR_OTHER_TAG_ID"],
"add_tag_groups_ids": ["YOUR_TAG_GROUP_ID"],
"remove_tag_groups_ids": ["YOUR_OTHER_TAG_GROUP_ID"]
}
{
"name": "Amara Okafor",
"email": "amara@okafor.example",
"phone_number": "+2348031234567",
"location": "Abuja, Nigeria",
"avatar": "https://example.com/amara.png",
"external_customer_id": "2348031234567",
"tag_ids": ["YOUR_TAG_ID"],
"tag_group_ids": ["YOUR_TAG_GROUP_ID"]
}
| Field | Required | What it is |
|---|---|---|
name | No | Their name |
email | No | Their email address |
phone_number | No | Their phone number, with the country code |
location | No | Where they are |
avatar | No | A web address for their picture, starting with http:// or https:// |
external_customer_id | No | Their ID on a channel, such as their WhatsApp number. Shown as Channel ID. |
add_tags_ids | No | IDs of tags to add – v3 only. To tag by name instead, use Add tags to a customer. |
remove_tags_ids | No | IDs of tags to remove – v3 only |
add_tag_groups_ids | No | IDs of tag groups to add – v3 only |
remove_tag_groups_ids | No | IDs of tag groups to remove – v3 only |
tag_ids | No | IDs of every tag the customer should have – v2 only. Tags not in the list are removed. Leave it out to keep their tags as they are. |
tag_group_ids | No | IDs of every tag group the customer should have – v2 only. Works the same way as tag_ids. |
Important:
tag_idsreplaces all the customer’s tags, including ones live agents added in Proto."tag_ids": []removes them all. Use v2 only when your own system decides all of a customer’s tags.
To clear a field, send an empty string, such as "location": "" – null isn’t accepted. To set custom fields, use Set custom fields on a customer.
Response
Proto replies 200 OK with the whole customer, after the update:
{
"id": "01JC8Z4M9W3T6Q2K7N5R1B8XHD",
"subcompany_id": "01HSWE652DMW6REJ1FB1135PRZ",
"provided_unique_id": "CRM-48213",
"external_customer_id": "2348031234567",
"name": "Amara Okafor",
"location": "Abuja, Nigeria",
"email": "amara@okafor.example",
"phone_number": "+2348031234567",
"avatar": "https://example.com/amara.png",
"tags": [
{ "id": "01HZ0QK3V7B2M8D4F6G9J1N5PR", "tag": "VIP", "color": "#16a34a" }
],
"tag_groups": [
{ "id": "01HZ0QM8C2D4F6H8K1N3Q5S7UW", "name": "Plan", "color": "#2563eb", "tags": [] }
]
}
| Field | What it is |
|---|---|
id | Proto’s own ID for the customer, shown as Person ID |
subcompany_id | Your teamspace ID |
provided_unique_id | Your ID for the customer, shown as Unique ID |
external_customer_id | Their ID on a channel, such as WhatsApp, shown as Channel ID |
tags | All their tags, each with its id, name (tag) and color as a hex code |
tag_groups | All their tag groups, each with its id, name, color and the tags in it |
Errors
| You get | What it means |
|---|---|
400 | The same tag or tag group ID is in both an add and a remove list. |
404 | No customer with this ID is in your teamspace, or a tag or tag group ID isn’t. Nothing was saved. To create the customer if they’re not in Proto, use v1 of Create a customer. |
422 | A field is null or isn’t text, or avatar isn’t a web address. |
| You get | What it means |
|---|---|
404 | No customer with this ID is in your teamspace, or a tag or tag group ID isn’t. Nothing was saved. To create the customer if they’re not in Proto, use v1 of Create a customer. |
422 | A field is null or isn’t text, or avatar isn’t a web address. |
For errors any request can return, see If something goes wrong.