> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Upsert contacts

> Batch create or update HubSpot contacts by unique property.

Use `hubspot.upsertContacts` to batch create or update HubSpot contacts by unique property.

```ts automations/hubspot-upsert-contacts.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { hubspot } from "automate.ax/hubspot"

export default automation("Upsert contacts", () => {
  onDashboardRun({ title: "Upsert contacts" })
  hubspot.upsertContacts({
    contacts: [
      {
        idProperty: "email",
        id: "ada@acme.example",
        properties: [{ name: "firstname", value: "Ada" }],
      },
    ],
  })
})
```

## Inputs

Provide 1–100 contacts. Each row names its unique `idProperty`, identifier `id`, and writable properties. Optional second argument `{ account }` selects a named HubSpot binding.

## Output

Returns the created or updated `contacts`. Replaying the same unique identifiers is safe. If HubSpot rejects any row, the action fails instead of returning an incomplete result.
