hubspot_update_contact
HubSpot write medium risk
Part of the HubSpot Agent.
What it does
Update properties on an existing HubSpot contact identified by record id. Sends only the properties provided (PATCH semantics -- omitted properties are untouched). Returns the standard envelope {success:true,data} where data is {applied, result}; result is the updated contact: id, the resulting properties, and updatedAt. Use to correct or enrich a contact with the client's OWN consented data (e.g., set lifecyclestage to MQL after a LinkedIn lead converts, set hs_lead_status, write a LinkedIn campaign attribution custom field). Prefer hubspot_upsert_contact when you only have an email and want create-or-update; use this when you already hold the contact id and the record must exist. Two-phase (ADR-028/029, the same gate as Google and LinkedIn writes): the first call (no preview_id) builds the request locally, apart from the read-only lookups described here, and returns a preview_id - nothing is changed in HubSpot; after the user approves that preview in a later message, re-call with that preview_id and identical arguments to COMMIT (single-use, 30 min; a changed, forged or replayed token fails closed). The preview includes the record's current values for the properties being changed (read when the preview is made; not re-read at commit). Where consent_confirmed exists it must be true at preview and at commit. [POLICY] Update ONLY the authorizing client's own contacts with that client's consented data; never write enriched/appended/verified third-party attributes, never propagate data across clients, and never persist member-derived fields past retention. Hash PII where the destination supports it. [REMINDER] PATCH only the fields you intend to change; preview before write. [WHEN TO USE] Use to apply an approved, consented field change to a known contact id; do NOT use to overwrite with externally sourced or cross-client data.
When to use it
Use to apply an approved, consented field change to a known contact id; do NOT use to overwrite with externally sourced, appended, or cross-client data.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
contact_id | string | yes | HubSpot contact record id (hs_object_id) to update. |
properties | object | yes | Property map to set; only these fields change (e.g., {lifecyclestage, hs_lead_status, jobtitle, linkedin_campaign_id}). |
consent_confirmed | boolean | yes | Must be true: caller attests the update uses the client's own consented data. False blocks the write. |
preview_id | string | no | Omit it to preview: nothing is applied, and the call returns a preview_id bound to this exact request. Pass it only after the user approves that preview in a later message, with the same arguments (leave out validate_only, and add any confirmation flag the preview names). Single-use, expires in 30 minutes; changed arguments need a fresh preview. |
Safeguards
A change in two steps. The first call previews and changes nothing; Claude shows you the preview and applies it only after you approve, within 30 minutes and with the same arguments. Every applied change goes to the audit log. How changes are approved.
Policy
Update ONLY the authorizing client's own contacts with that client's consented data. NEVER write enriched/appended/verified third-party attributes, propagate data across clients, or persist member-derived fields past LinkedIn retention (profile <=24h, social activity <=48h). Hash PII where the destination supports it; honor deletion-on-request.
Reminder
PATCH semantics -- only the supplied fields change; preview the before/after and confirm consent.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
auth | Invalid or expired OAuth token / session (401 Unauthorized). | Refresh the HubSpot OAuth token and retry; do not reuse the rejected token. | no |
permission | Token lacks crm.objects.contacts.write scope or portal denied access (403 Forbidden). | Grant crm.objects.contacts.write and reconnect; surface the missing scope. | no |
validation | HubSpot 400: invalid property name, read-only/calculated property, or malformed value (e.g., bad lifecyclestage internal value). Surface HubSpot's exact propertyName message. | Correct the property/value and re-preview before retrying; do not retry verbatim. | no |
not_found | No contact with that id (404 Not Found) -- may be deleted or merged. | Verify the id (resolve via email if needed); if merged, target the surviving record. | no |
rate_limit | HubSpot 429 Too Many Requests (TEN_SECONDLY_ROLLING or daily policy). | Honor Retry-After/X-HubSpot-RateLimit-*; back off with jitter; serialize sync writes. | yes |
platform | HubSpot server error (500/502/503). | Retry with exponential backoff; if persistent, report HubSpot unavailability and do not drop the change silently. | yes |
invalid_argument | HubSpot API 2026-09 enforces this portal's validation rules on every write (conditionally required properties, properties required at creation, the Edit Associations permission). A violation is a 400 VALIDATION_ERROR: when errors[].code is MISSING_* the tool returns invalid_argument naming the rule and the property; any other invalid value returns invalid_argument with HubSpot's own message. | Supply the property the rule names, or fix the value HubSpot's message names (HubSpot internal property names), then re-preview. For "Missing 'Edit Associations' permission." no argument change helps: a HubSpot admin must give the user who connected Scalix the Edit Associations permission (Settings > Users & Teams), then re-preview. | no |
Edge cases
- PATCH is partial: omitted properties retain prior values -- never send a full object expecting blanks to clear fields.
- Setting a property to empty string clears it; setting null may be rejected -- use empty string to clear text fields.
- Read-only/calculated properties (e.g., hs_object_id, createdate) cannot be written and return 400.
- Concurrent nightly-sync updates can race -- last write wins; serialize per contact id.
- Idempotency: re-sending the same property values is safe and yields the same state.
- Consent gate: block if consent_confirmed is false or data is member-derived beyond retention.