Delete secondary/additional emails via API using Zapier

Delete secondary/additional emails via API

I am trying to run the Delete secondary/additional emails via API using Zapier. My hope is that I can run batches (we have 30k+ records with secondary email and many of them are just wrong - this is something I inherited!). I am trying to use the V1 endpoint here: Accounts Dashboard | HubSpot

I keep getting a Failed to create a http request in HubSpot | Unable to parse value for path parameter: vid

I created a Google Sheet to use as a trigger, but can’t get the tests to work. I’ve got 3 columns (A) VID, B) Email, C) Additional Emails and am matching to Columns A & C (VID & Additional Emails).

Any thoughts what might be wrong? It appears to me to be recognizing the data properly, but I’m obviously missing something. (The IDs in the screenshots are two different tests, hence the different IDs. But the error hasn’t changed. I also swapped the emails for privacy purposes, but the format is the same).

Zapier uses {{FIELDNAME}} notation for variables. So you need to update your URL to something like (using the v1 API since that’s what you’re showing):

https://api.hubapi.com/contacts/v1/secondary-email/{{:vid}}/email/{{:email}}

Which should generate the correct URL. You are currently passing those in as query parameters (which will be ignored).

Thank you for the response. My apologies for not accepting it right away as I was pulled away to another project that took all of my attention. The above answer was definitely helpful, however I am still having an issue getting this Zap to work. I am now getting a Failed to create a http request in HubSpot: Invalid URL

  • I have tested the URL in Postman and everything works perfectly
  • I have tried this with the Content-type = application/json header and without
  • I tried to add a formatter step for the ID ({VID}}, but that just tries to add spaces or commas to the ID. The column is formatted as a number in Sheets (which is where the data for the API step originates). It appears correct below (when testing in Postman I copied the URL from Zapier - different record obviously since it worked and removed the additional email on that record)
  • I have also tried using a Webhook instead of the API

All ideas appreciated

Any other ideas?

I finally found a solution here, so thought I’d share in case others have a similar issue:

Add headers for:

  • Content-type = application/json
  • Authorization: Bearer [your-private-app-key]