Skip to main content

HubSpot

Read and write a HubSpot account's CRM - contacts, companies, deals, tickets and custom objects - plus associations, timeline activity, lists, forms and marketing reporting.

Connect a HubSpot account with a service key to work its CRM end to end: discover the account's own object types, properties, owners and pipelines; list, search, create, update, upsert and archive records of ANY object type including custom ones; link records with associations; write notes, tasks and logged calls, meetings and emails onto timelines; manage manual list membership; and read forms, marketing emails and campaigns. Tickets, line items, products and custom objects need no dedicated tools - they are object types passed to the generic record tools.

Connect​

Credential fieldRequiredWhere it comes from
Service key (ACCESS_TOKEN)YesFrom Development → Keys → Service keys → your key → Show → Copy. Its scopes decide what Yekar.AI can do in HubSpot.
SettingRequiredWhat it is
Account ID (PORTAL_ID)NoThis account's numeric id, shown by Get account. Only Submit form needs it; leave blank to have it looked up.

Tools​

ToolAccessWhat it does
Get account (yekar.hubspot.get-account)ReadThe HubSpot account this connection points at - account id, account type, time zone, currency and UI domain. Call this to verify the connection works and to learn the account id and time zone that date-valued properties are interpreted in. Needs the service key's oauth scope.
List object types (yekar.hubspot.list-object-types)ReadEvery CRM object type this account has: HubSpot's standard ones (contacts, companies, deals, tickets, …) plus the account's custom objects with their objectTypeId, labels, primary display property and required properties. Start here when you don't know what the account calls something - every type listed works with the generic record tools.
List properties (yekar.hubspot.list-properties)ReadThe properties an object type actually has in THIS account - internal name, label, type, field type, allowed option values, and whether it is calculated (read-only). HubSpot accounts customise their schema heavily, so call this before creating or updating a record rather than guessing property names. Filter with search when an account has hundreds.
List owners (yekar.hubspot.list-owners)ReadThe account's owners (HubSpot users records can be assigned to) - owner id, email and name. The hubspot_owner_id property on any record takes one of these ids, never an email or a user id, so resolve the person here before assigning a record, note or task.
List pipelines (yekar.hubspot.list-pipelines)ReadAn object type's pipelines and their stages, in display order - for deals and tickets. Deal and ticket stage properties store opaque stage IDS, so resolve the stage you mean here before creating or moving a record; guessing a label will fail validation.
List records (yekar.hubspot.list-records)ReadA page of records of any CRM object type, oldest id first, with cursor paging. Works for contacts, companies, deals, tickets, line items, products, notes, tasks and any custom object. Ask for the properties you need - HubSpot returns only a small default set otherwise. This endpoint reports no total; use Search records to count or to filter.
Get record (yekar.hubspot.get-record)ReadOne record of any CRM object type, by HubSpot id or by a unique property (idProperty: "email" for a contact, "domain" for a company) - so you can look someone up without knowing their internal id. Ask for the properties you need and optionally the ids of associated records.
Search records (yekar.hubspot.search-records)ReadSearch any CRM object type by free text and/or property filters, returning HubSpot's own total match count. Filter groups are ORed and the filters inside each are ANDed. This is the tool to use whenever you need a COUNT or a filtered set - List records neither filters nor counts. Note that search is eventually consistent and stops paging at 10,000 results.
Batch read records (yekar.hubspot.batch-read-records)ReadRead up to 100 records of one object type in a single call, by id or by a unique property such as email. Far cheaper against HubSpot's rate limit than looping Get record. Ids that do not resolve come back in missing rather than failing the whole call.
Create record (yekar.hubspot.create-record)WriteCreate a record of any CRM object type - contact, company, deal, ticket, line item, product or custom object - from a property map. Call List properties first: property names are specific to each account, and deal/ticket stages take stage IDS from List pipelines. Creating a contact whose email already exists is a conflict that reports the existing id. To link the new record to others, call Associate records afterwards.
Update record (yekar.hubspot.update-record)WriteSet properties on an existing record of any CRM object type. Only the properties you pass are touched - an empty string clears one. Moving a deal or ticket between stages is an update to dealstage / hs_pipeline_stage with a stage id from List pipelines; completing a task is an update to hs_task_status.
Upsert records (yekar.hubspot.upsert-records)WriteCreate-or-update up to 100 records in one call, matched on a unique property such as email or domain. This is the converging write: running it twice with the same input leaves the same records, so prefer it over Create record whenever the data has a natural key. Also the right answer to a 'contact already exists' conflict.
Delete record (yekar.hubspot.delete-record)WriteArchive a record of any CRM object type. This is HubSpot's delete: the record goes to the recycling bin (restorable in the UI for roughly 90 days, still readable with archived: true) rather than being erased. It disappears from lists, reports and active automations straight away.
List associations (yekar.hubspot.list-associations)ReadThe records of one object type associated with a given record - a contact's companies and deals, a deal's line items, a company's tickets. Returns the associated ids plus any association labels the account has defined (unlabelled default associations have none). Use Batch read records to turn the ids into full records.
Associate records (yekar.hubspot.associate-records)WriteLink two records with HubSpot's default association for their types - put a contact on a company, a deal on a contact, a note on a ticket. The association is bidirectional and the default type is resolved by HubSpot, so no association type id is needed. Re-running is harmless.
Disassociate records (yekar.hubspot.disassociate-records)WriteRemove the link between two records. This removes every association type between them, labelled ones included, and deletes neither record. Re-running on an already-unlinked pair is harmless.
Create note (yekar.hubspot.create-note)WriteWrite a note onto one or more records' timelines - the standard way for an agent to record what it found or did. The body is rendered as HTML. At least one association is required, because an unassociated note is invisible in the HubSpot UI.
Create task (yekar.hubspot.create-task)WriteCreate a task in HubSpot with a subject, due date, priority and assignee, optionally attached to records. Assign it to an owner (see List owners) or it lands in no queue. To complete or reassign an existing task, use Update record on the tasks object type - there is no separate tool for that.
Log activity (yekar.hubspot.log-activity)WriteLog a call, meeting or email that already happened onto one or more records' timelines. One observable effect - the type only selects which HubSpot object and property names are used. This records history; it does not place a call, book a meeting or send an email.
List record activity (yekar.hubspot.list-record-activity)ReadA record's timeline - its notes, calls, meetings, emails and tasks merged into one list, newest first. Answers 'what has happened with this account lately' in a single call instead of five association lookups. The response reports the true total per activity kind, so you can tell when you are seeing only the most recent slice.
Search lists (yekar.hubspot.search-lists)ReadFind the account's lists (segments) by name and processing type, with HubSpot's own total. The processing type matters before you try to change membership: DYNAMIC lists compute their members from filters and reject membership writes, while MANUAL and SNAPSHOT lists accept them.
Get list (yekar.hubspot.get-list)ReadOne list (segment) by id, or by exact name plus object type - its size, processing type and status. Check processingType before attempting a membership change: DYNAMIC lists are filter-driven and cannot be edited by adding or removing records.
List list memberships (yekar.hubspot.list-memberships)ReadThe record ids in a list, with HubSpot's own total membership count and cursor paging. Returns ids only; pair it with Batch read records to get the underlying contacts or companies.
Update list memberships (yekar.hubspot.update-list-memberships)WriteAdd records to and/or remove records from a MANUAL or SNAPSHOT list in a single operation. DYNAMIC lists are rejected: their membership is computed from the list's filters, so change the filters or the records' properties instead. The response reports which additions HubSpot actually applied - a record already in the list is not re-added.
List forms (yekar.hubspot.list-forms)ReadThe account's marketing forms with their field definitions - id, name, type and each field's internal name and whether it is required. Find the form you want here, then use Submit form to push a submission through it.
Get form (yekar.hubspot.get-form)ReadOne form's full definition - every field's internal name, label, type, target object and whether it is required. Read this before Submit form: the submission is keyed by the fields' INTERNAL names, and omitting a required one is rejected.
Submit form (yekar.hubspot.submit-form)WriteSubmit values to a HubSpot form as if a visitor had filled it in - creating or updating the contact through the form's own pipeline, which also triggers the automations and notifications the form is wired to. Field keys are the form's internal field names (see Get form). This is the only tool that talks to api.hsforms.com.
List marketing emails (yekar.hubspot.list-marketing-emails)ReadThe account's marketing emails - name, subject line, state (draft, scheduled, published), sender and publish date. Read-only: this integration does not create, edit or send marketing emails. Requires the service key's marketing-email scope and a Marketing Hub plan that includes the email API.
Get marketing email (yekar.hubspot.get-marketing-email)ReadOne marketing email with its performance counters - sends, deliveries, opens, clicks, bounces and unsubscribes, plus HubSpot's own computed ratios. The counters come straight from HubSpot's statistics endpoint and are not recomputed here. Read-only.
List campaigns (yekar.hubspot.list-campaigns)ReadThe account's marketing campaigns with whichever campaign properties you ask for - names, goals, budgets and the attribution metrics HubSpot computes. Read-only, and useful for answering 'which campaign drove this' questions alongside the CRM records. Requires a Marketing Hub plan that includes campaigns.

Notes​

  • In HubSpot, go to Development → Keys → Service keys and click Create service key. Only super admins and people with Developer tools access can do this. Name the key (e.g. "Yekar.AI").
  • Click Add new scope and tick what Yekar.AI may do - the key can do exactly this and nothing more, and you can only tick scopes your own HubSpot user has. For records, tick crm.objects.<type>.read and crm.objects.<type>.write for each kind of record you want to use (contacts, companies, deals, tickets…), plus crm.schemas.<type>.read so their fields can be looked up; custom objects also need crm.schemas.custom.read. Add crm.objects.owners.read for owners, crm.lists.read and crm.lists.write for lists, forms for forms, marketing-email for marketing emails, marketing.campaigns.read for campaigns, and oauth for Get account.
  • Click Create and confirm. Then open the key, click Show, then Copy, and paste it here. When a tool needs a scope the key does not have, the error names it.
  • To add a scope later, open the key and click Edit - the same key keeps working, so there is nothing to re-paste. If you rotate the key, paste the new one here before the old one expires (7 days later, or straight away if you chose Rotate and expire now).
  • Optionally set the Account ID property to the account's numeric id. Only Submit form uses it; without it, Submit form looks it up, which needs the oauth scope.
  • Add one credential per HubSpot account - keys for a production and a sandbox account can live on the same connection.