Add Additional Email via API v3 - hs_additional_emails
SOLVE
Hi. I see in previous posts that the only way to add secondary emails was to use the legacy v1 endpoint. However, I also see that there is some documentation of about using the property hs_additional_emails in the current docs.
However, trying to patch the contact with the property
hs_additional_emails fails with the following message.
{
"status": "error",
"message": 'Property values were not valid: [{"isValid":false,"message":"\\"hs_additional_emails\\" is a calculated property; its value cannot be set.","error":"READ_ONLY_VALUE","name":"hs_additional_emails"}]',
"correlationId": "9e699278-b9f1-4f14-a756-fdb2b6ffe03a",
"errors": [
{
"message": '"hs_additional_emails" is a calculated property; its value cannot be set.',
"code": "READ_ONLY_VALUE",
"context": {"propertyName": ["hs_additional_emails"]},
}
],
"category": "VALIDATION_ERROR",
}
You've rightly pointed out the documentation needs to be updated. It currently states:
To add secondary emails to a contact, when creating or editing the contact, in your request body, include emails in the hs_additional_emails field. Multiple emails can be separated by a semi-colon.
Given this property is "read only" (i.e. modificationMetadata.readOnlyValue = true), updating it via the relevant API V3 endpoints is not possible. As far as I know, the V1 endpoints are still operational, so I think you'll have to use them for now.
I hope this proves helpful. Please let me know if you have any follow-up questions.
All the best,
Zach
--
Zach Klein HubSpot Integrations & App Developer Meanjin / Brisbane, Australia
You've rightly pointed out the documentation needs to be updated. It currently states:
To add secondary emails to a contact, when creating or editing the contact, in your request body, include emails in the hs_additional_emails field. Multiple emails can be separated by a semi-colon.
Given this property is "read only" (i.e. modificationMetadata.readOnlyValue = true), updating it via the relevant API V3 endpoints is not possible. As far as I know, the V1 endpoints are still operational, so I think you'll have to use them for now.
I hope this proves helpful. Please let me know if you have any follow-up questions.
All the best,
Zach
--
Zach Klein HubSpot Integrations & App Developer Meanjin / Brisbane, Australia