HubSpot whoami (signed-in account)
Report which HubSpot account this browser is signed in as: the numeric user id, email, first name and last name. Being signed out is reported as a normal answer (loggedIn false), not an error, so it can be used to check a session before running other HubSpot scripts.
Input
None
Output
evidence requiredloggedIn requiredemail optionaluserId optionallastName optionalfirstName optionalFAQ
HubSpot login (Google SSO)
Log into HubSpot (app.hubspot.com) with Google SSO: submits your email, signs in through Google, and handles the account chooser and first-time consent. HubSpot then shows a new-device email-verification step: pass the 6-digit code as `code`, or sign in once manually so HubSpot trusts the device — that confirmation is reliable only on a trusted device, so in practice this re-logs you in after one manual sign-in. `email` is required for a fresh sign-in: HubSpot's login is identifier-first, so the Google option only appears once an email is submitted, and it also selects which Google account to use.
List HubSpot invoices
List the billing invoices on a HubSpot account, taken from Account & Billing → Transactions: each invoice's number, date, amount, status, and a link to its PDF. The PDF link is tied to the signed-in session, so it only opens while that session is still active. Sign in to HubSpot in the browser this runs against before using it — signed out, the script says so rather than returning an empty list. Pass portalId to target a specific portal when the account has more than one.
Search HubSpot contacts
Search the contacts in a HubSpot account and return the matching rows with name, email, phone, owner, company and dates. Finds the right account and region automatically, and reports a search that matches nothing as an empty result.
