There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API keys are no longer a supported authentication method for accessing HubSpot APIs. Instead, you should use a private app access token or OAuth to authenticate API calls. Learn more about this change and how to migrate an API key integration to use a private app instead.

How do I send transactional emails?

HubSpot supports two methods of sending transactional emails: the SMTP API and the Single-send API.

Using the SMTP API

The SMTP API does not send emails directly, but is only used to get login credentials for the HubSpot SMTP server.  After you get a token and password using the SMTP API, you'll need to use those credentials to log into HubSpot's SMTP server and send the email over SMTP. The login details (hostname and port) for the SMTP server can be found on the documentation page. The email and links will be wrapped to support HubSpot's email tracking, but otherwise you will need to build the entirety of the email content.

Using the Single-send API

The Single-send API uses template emails created in the HubSpot Email tool, along with a JSON formatted POST API to send emails. You'll first need to create an email in HubSpot as normal, selecting "Save for single send API" when choosing the recipient.  After the email is created, you can use the API to send the email to a contact, setting the details for the recipient (including any contact or custom properties set up in the email) in the body of the API request.  More details for the format of that JSON request can be found on the documentation page.