There's a new version of the HubSpot API

We're also working on a new documentation website, you're invited to check it out and give us your feedback.


Last updated May 27, 2022


Method Details

HTTP Methods:


Response Format:


Requires Authentication?


Rate Limited?






Required Scope:


If you have a Marketing Hub Enterprise account, use this API to trigger a custom behavioral event using an HTTP GET request. Event completions can be tracked in HubSpot and used to segment contacts, score leads, and more.

Please note: if you have an EU portal you must use the tracking server

Please note:

Response details

If the request is successful, it will have a status code of 200 with no data in the body. The content-type will be image/gif, so it's possible to use HTTP API urls with <img> tags, though we recommend using the JavaScript API on webpages when possible.


All parameters below are used in the request URL.

Please note: all symbols in a contact's email address must be encoded, except for the following:

  • @ symbol
  • hyphen -
  • underscore _ 
  • period .
Required Parameters How to use Description
HubSpot Hub (portal) ID &_a=XXXXXX Your HubSpot Hub ID. See this page for help finding your Hub ID.
Event ID &_n= The ID or name of the event you want to trigger. See here for more details.
Optional Parameters How to use Description
Contact Email Address & Associates the event with a known HubSpot contact. If the contact doesn't yet exist in HubSpot, it will be created.
Contact Revenue &_m=20 Any numerical amount that you provide here will increment the contact's Revenue field within the Web Analytics History section.
Any Contact Property &{property}={value} If your account was created before September 8, 2021 and is set up to allow contact properties to be updated through the tracking code, you can also include any contact properties with the event that you’re triggering. This will populate the corresponding contact property for the contact specified by the email parameter. For example, if you have a property with the name favorite_color, you can populate that property using &favorite_color=orange
External id &id={value} Ties the event to a record based on an external ID (not the HubSpot contact's ID). Unlike email, including this id will not automatically create a contact record. You would need to have some event associating the ID with an email, such as a previous HTTP Event call with both the ID and email, or by using the ID with the JavaScript API for a visitor that was associated with an email address.