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.

SMTP API Tokens - Password Reset

Last updated May 15, 2023

POST /email/public/v1/smtpapi/tokens/:userName/password-reset

Method Details

HTTP Methods:

POST

Response Format:

JSON

Requires Authentication?

Yes

Rate Limited?

Yes

Required Scope

transactional-email

Once you have an SMTP API, the List SMTP API Tokens endpoint can be used to list all SMTP API Tokens in the portal. However, for security reasons the password is only provided during the time of the token creation. This endpoint allows for the creation of a replacement password for a given Token, keyed by the userName field. Once the password is successfully reset, the old password for the token will be invalid.

Note that use of API requires the Transactional Email add-on.

Required Parameters How to use Description
OAuth Access Token Authorization: Bearer {token}
Used in the request headers

Used to authenticate the request. Please see this page for more details about authentication.

userName Used in the request URL The userName field of the SMTP API Token needing a password reset.

Example

Example URL: POST https://api.hubapi.com/email/public/v1/smtpapi/tokens/zh48wgsfld%4062515.smtp.hubspot.net/password-reset

Example JSON Response

{
  "portalId": 62515,
  "userName": "aezckvh3hx@62515.smtp.hubspot.net",
  "password": "ItUuCc8h4I5MihiysY8HB6XSbWZmVZ",
  "passwordHash": null,
  "emailCampaignId": 14860979,
  "createdAt": 1415740569008,
  "deleted": false,
  "createdBy": "demo@hubspot.com",
  "appId": 22709,
  "campaignName": "test transactional email"
}

SMTP API

After resetting the password for the token above, you can use SMTP to send an email:
  • SMTP Hostname: smtp.hubapi.com
  • SMTP Port: 587 (for STARTTLS) or 465 for TLS
  • SMTP User Name: hrfdvt58el@62515.smtp.hubspot.net
  • SMTP Password: 3432fff8eljl1249fjjasdfnv3