API query to external tool to check if an email is a client

Good morning partners,

I need to establish a query through the Hubspot API in such a way that, when a prospect is registered, Hubspot sends the email field to an external tool and it responds if that email exists in the customer database.

If you are a customer, let the Life Cycle field in Hubspot automatically change to client.

Do you know how to do it?
Thank you!

Hi @Anonymous , HubSpot does not send any info, rather, you’d need query your own system based on the email property that has been updated in HubSpot. If the lifecycle stage is in your external system, then make another POST request to HubSpot with that updated value to change it.

To trigger when to make this request to HubSpot, you’ll likely need to either occasionally poll the Get Form Submission endpoint for the particular form that folks are using to register with your product, or use a webhook in a workflow if you have this feature, or the Webhooks API (different from webhook workflow actions - available at any pricing tier).

Here’s a great graphic on polling vs webhooks:

For HubSpot endpoints to use, you’ll need the Forms API, the Contacts API, and perhaps webhooks as I mentioned. Hopefully this gets you started in the right direction.

Welcome, @Anonymous.
To piggyback off of Connor’s response, I see a few potential approaches:

  1. If the account has an Enterprise-level subscription or Professional-level subscription with grandfathered workflow webhook access, then you could set up a contact-based workflow containing a Trigger a webhook. This action will send the contact’s JSON-formatted data to an external endpoint in a POST request. It’s not possible to just send a contact’s email value, so there may have to be some intermediary app to parse the full JSON payload which would pick out the email value and then send it off to the service or database. Once the value is checked against the external system, you could use the Contacts API to update the corresponding record’s Lifecycle stage value in HubSpot (e.g. with this endpoint).
  2. Alternatively, you could exclusively use the Contacts API, retrieving newly created contacts with this endpoint, extracting the email value with an intermediary app, and then sending it to your external database. Once the value is checked, you would again use something like this endpoint to update the contact’s Lifecycle stage.
  3. Similar to Option 2, you could initially create an active list with the criteria you wish and retrieve the contacts within using this endpoint.