View as Markdown
HubSpot icon

HubSpot ACTION

Create or Update Contact

Create a contact in HubSpot, or update it when one with the same email already exists (enable Update If Exists). Put contact fields in Object Properties as HubSpot internal names. Example: Object Properties { "email": "ada@example.com", "firstname": "Ada", "jobtitle": "CTO" }. Returns the created or updated contact with its id. See the documentation
  • Action
  • Writes data
  • Destructive
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's HubSpot account once, then configure and run Create or Update Contact from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "hubspot-create-or-update-contact",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    hubspot: { authProvisionId: "apn_xxxxxxx" },
    objectProperties: "Object Properties",
    updateIfExists: true,
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create or Update Contact inputs
Property Type Description
objectProperties Object Properties object
Enter the object properties to create as a JSON object
Required
updateIfExists Update If Exists boolean
When selected, if Hubspot returns an error upon creation the resource should be updated.
Required

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
hubspot-create-or-update-contact
Version
1.0.1
App
HubSpot
Authentication
OAuth
Read-only
No
Destructive
Yes
Open world
Yes