n8n
n8n copied to clipboard
HubSpot - Create contact without email results in 404
Describe the bug
When creating a contact via the HubSpot node without specifying the email address (or the email field) is empty, the node will fail and the API will return 404 with an error message of The resource you are requesting could not be found.
To Reproduce Steps to reproduce the behavior:
- Create a workflow with the HubSpot node
- Set up the authentication
- Pass the following JSON document to the node:
{
"firstName": "John",
"lastName": "Doe",
"occupation": "Sales Manager",
"email": ""
}
- Map the fields, particularly the
emailfield. - See the error as above.
Expected behavior The HubSpot API mentions the following:
While we recommend that all contact records include an email address, it is possible to create contacts without an email address by leaving out the email property.
So therefore, it should be possible to create a contact without specifying an email address.
Environment (please complete the following information):
- OS: Official N8N Docker Image
- n8n Version 0.191.1
Additional context I believe the fix should be to make email in the HubSpot node also optional along with all the other properties. The tricky part is because this call can also be used to upsert a particular contact (using email as an ID), maybe another option would be to create a new call for just creating contacts.
Hey @bt,
I have just given this a test and have managed to reproduce the issue, I have created an internal ticket for this issue which we will be tracking as N8N-4506
Hey @Joffcom, thanks for that! Let me know if there's anything you'd like me to assist with 😄
Hey @bt,
I have just been going through some older tickets and I have looked at this again, The issue here is because we are using "Create or Update" which does require an email address for the match.
We decided during the overhaul of the node not to change this based on the hubspot recommendation and I don't think this will change soon.
I have kept the dev ticket open so if we do decide to split the create / update action into 2 we can implement this but for now I think it is safe to close this as it isn't planned.
Let me know if you have any questions on this.