Guides / n8n × HubSpot / Data Validation

Fix HubSpot VALIDATION_ERROR when creating a contact or deal

The 400 body lists every rejected property individually with a machine-readable error code. How to read it, the four codes that account for almost all of them, and the deal fields HubSpot requires that contacts do not.

FlowPatch diagram: Payload to field validation to create. Check type, required fields, and association.
400 — {"status":"error","category":"VALIDATION_ERROR","message":"Property values were not valid: [{\"isValid\":false,\"error\":\"INVALID_OPTION\",\"name\":\"dealstage\"}]"}
Short answer: A HubSpot VALIDATION_ERROR is per-property and the body names each offending property with its own error code. PROPERTY_DOESNT_EXIST means you sent a label instead of an internal name. INVALID_OPTION means the property is an enumeration and the value is not one of its option values. INVALID_LONG or INVALID_DATE means the value shape is wrong for the property type. Creating a deal additionally requires dealstage and pipeline to be internal IDs that belong to the same pipeline. Parse the body, map values before sending, and route unmappable rows to an error branch rather than retrying.

The body is a list, not a sentence

HubSpot returns one entry per invalid property, each with isValid, a message, a machine-readable error string and the property name. A payload with three bad fields produces three entries, so the first failure is not necessarily the only one — fixing it and retrying can produce the same status code with a different property named, three times over.

Parse the whole list and act on all of it at once. The error string is the useful field; the human message is descriptive text that varies and should not be pattern-matched.

HTTP/1.1 400 Bad Request

{
  "status": "error",
  "category": "VALIDATION_ERROR",
  "message": "Property values were not valid: [
     {\"isValid\":false,\"message\":\"gold is not one of the allowed options\",
      \"error\":\"INVALID_OPTION\",\"name\":\"customer_tier\"},
     {\"isValid\":false,\"message\":\"Property \\\"Close Date\\\" does not exist\",
      \"error\":\"PROPERTY_DOESNT_EXIST\",\"name\":\"Close Date\"}]",
  "correlationId": "7b2e..."
}

# Two independent problems in one response:
#   customer_tier -> value not in the options list
#   "Close Date"  -> label sent where the internal name closedate was needed

The four codes that cover almost everything

PROPERTY_DOESNT_EXIST is a key problem: the payload used a UI label rather than the property's internal name, or targeted the wrong object type or portal. INVALID_OPTION is a value problem on an enumeration property: the key resolved, and the string sent is not one of the option values that property defines. The remaining two are type problems — a number property sent a non-numeric string, or a date property received something that is not a midnight-UTC timestamp or an ISO date.

VALIDATION_ERROR codes and what to change

errorMeaningFix
PROPERTY_DOESNT_EXISTKey is not a property internal name on this objectResolve names from /crm/v3/properties/{objectType}
INVALID_OPTIONEnumeration value not in the property's optionsMap source values to option.value, not option.label
INVALID_LONG / INVALID_DOUBLENumber property received a non-numeric valueCast before sending; empty string is not zero
INVALID_DATEDate property received the wrong shapeSend YYYY-MM-DD or a midnight-UTC epoch, per the property type

Deals demand more than contacts do

A contact create can succeed with a single property. A deal create realistically needs dealname, dealstage and pipeline, and the last two are the ones that fail: both take internal IDs, not the labels shown in the deal board, and the stage ID must belong to the pipeline ID sent alongside it. A stage ID from the default pipeline sent with a custom pipeline's ID is rejected even though both values exist and both look valid.

Fetch the pipelines once and resolve both IDs from the same response so they cannot drift apart.

GET https://api.hubapi.com/crm/v3/pipelines/deals
Authorization: Bearer pat-na1-xxxx...

{ "results": [
  { "id": "default", "label": "Sales Pipeline",
    "stages": [ { "id": "appointmentscheduled", "label": "Appointment Scheduled" },
                { "id": "closedwon",            "label": "Closed Won" } ] },
  { "id": "1794821", "label": "Renewals",
    "stages": [ { "id": "2910334", "label": "Up for renewal" } ] } ] }

POST https://api.hubapi.com/crm/v3/objects/deals
{ "properties": {
    "dealname":  "Acme renewal",
    "pipeline":  "1794821",
    "dealstage": "2910334",      // must belong to pipeline 1794821
    "amount":    "12000",
    "closedate": "2026-10-31"
} }

Validate in the workflow, not at HubSpot

Every one of these codes is detectable before the request leaves n8n, because the properties endpoint already returned the type and the option list for each property. A mapping step that casts numbers, formats dates and resolves enumeration labels to option values turns a HubSpot rejection into a local branch you control, and an unmappable row into a dead-letter item with a readable reason rather than a stack trace.

This matters more with batch endpoints. A /batch/create call carrying 100 records fails as a unit when one record is invalid, so a single unmapped value costs the other 99 records their write. Validate the whole array first, split the invalid rows out, and send the clean remainder.

Do not resolve a VALIDATION_ERROR by blanking the offending field. Sending an empty string to a required property converts the error rather than fixing it, and sending empty strings broadly overwrites real CRM data with blanks — a far more expensive mistake than the original failed write.

VALIDATION_ERROR is never transient. Retrying an unchanged payload produces the identical response, so route it to a dead-letter branch and keep retry budget for 429s and 5xxs.

How validation errors behave in batch calls

A single-record create fails cleanly: you get the 400, you fix the row, you move on. A batch call of 100 records behaves differently and the difference matters when a backfill is running unattended. HubSpot can return a multi-status response in which some records were created and others were rejected, with the errors reported per input rather than for the request as a whole.

A workflow that checks only the HTTP status treats that response as a failure and either retries all 100 — duplicating the ones that succeeded — or discards all 100, losing the ones that worked. Neither is acceptable in a backfill, and both are easy to write without noticing.

Parse the per-input results and act on them individually: keep the created IDs, and route the rejected inputs to a dead-letter branch with their error codes attached. Because the results correspond positionally to the inputs you sent, preserving that correspondence is what lets you say which source row produced which failure — without it you have a list of errors and no way to connect them to anything.

The cheaper fix is upstream. Validate the whole array against the property metadata before sending it, split out the rows that cannot be mapped, and submit only the clean remainder. A batch that was validated locally rarely produces a partial failure at all, which removes the need to handle one correctly under time pressure.

Where these facts come from