Guides / n8n × Pipedrive / Data Sync

Fix Pipedrive “Invalid Field(s) in the Payload” When Setting Custom Fields From n8n

Why custom field names that work fine in the Pipedrive UI get rejected by the API when n8n sends them, and how to find the internal key Pipedrive actually expects.

Illustrated comparison of a Pipedrive custom field's display name in the UI against its internal API key used in an n8n payload.
400 Bad Request — "Invalid field(s) in the payload: Website, LinkedIn" (or any other custom field display name)
Short answer: Pipedrive's API never accepts a custom field by the label you see in the UI ("Website", "LinkedIn", etc.) — it only accepts the field's internal key, a long alphanumeric hash generated when the field was created. If your n8n node or HTTP Request payload uses the display name as the JSON key, the API rejects it as an invalid field even though the field clearly exists and is visible in Pipedrive's interface.

Why the field's visible name never works in the payload

Every standard Pipedrive field (title, value, person_id) has a simple, predictable API key that matches what you'd expect. Custom fields do not — Pipedrive generates a unique internal key (a 40-character hash, unrelated to the field's display name) the moment a custom field is created, and that hash is the only key the API accepts for reading or writing that field's value.

This trips up almost everyone who builds a Pipedrive integration for the first time, because Pipedrive's own web UI never shows you the hash by default — you interact entirely with the human-readable label. n8n's node (and any direct API call) has no way to translate "Website" into the correct key automatically unless you explicitly map it yourself.

The field being visible and correctly named in the Pipedrive UI proves nothing about what key the API expects for it. Always look up the actual key before building the payload.

How to find the real API key for a custom field

In the Pipedrive web app, go to Company Settings (or Tools and Apps, depending on your plan) → Data Fields, choose the correct tab for the object the field belongs to (Deal fields, Person fields, Organization fields, etc.), find your custom field in the list, and open its three-dot menu. Select "Copy API key" — this copies the exact hash string the API expects, ready to paste directly into your n8n payload or expression.

If you'd rather confirm it programmatically (useful when scripting field mappings for many fields at once), call the relevant fields endpoint and match on the field's name property to find its key:

GET https://yourcompany.pipedrive.com/api/v2/dealFields
x-api-token: {{your_api_token}}

# Response includes objects like:
# {
#   "key": "a1b2c3d4e5f6...",   <- this is what you put in your payload
#   "name": "Website",           <- this is only the display label
#   "field_type": "varchar"
# }

Using the key once you have it

With the API v1 node, custom field keys sit as flat top-level properties on the record object being sent. With the newer API v2 node and endpoints (see the separate migration guide on this site for the full v1-to-v2 change), custom fields are nested under a custom_fields object instead — using the flat-key format against a v2 endpoint will also fail, just with a different error, so make sure the payload shape matches whichever API version you're actually calling.

// v1-style payload (flat key)
{
  "title": "New Deal",
  "a1b2c3d4e5f6...": "https://example.com"
}

// v2-style payload (nested under custom_fields)
{
  "title": "New Deal",
  "custom_fields": {
    "a1b2c3d4e5f6...": "https://example.com"
  }
}

Dropdown and multi-select custom fields need an extra step

Text and number custom fields just need the correct key. Dropdown (single-option) and multi-select custom fields go one level deeper: the field itself has a key, but each individual option inside a dropdown also has its own numeric ID, and the API expects that option ID as the value — not the option's visible text label. Look up the field's options list (included in the same fields endpoint response, under an options array) to find the correct numeric ID for the option you're trying to set, rather than assuming the readable label will be accepted.

Getting the value right, by field type

A correct key is only half the payload; each custom field type expects a specific value shape. Date fields take an ISO date string (YYYY-MM-DD) and time fields take HH:MM:SS. Monetary fields need the numeric amount plus a sibling key of the same hash with a _currency suffix carrying the three-letter currency code, or the value is stored without a currency and displays oddly.

Single-option and multi-option (set) fields take the option's numeric ID, not its label; multi-option takes a comma-separated string of IDs. Relation fields - person, organization, and user pickers - expect the related record's numeric ID. Address fields accept a plain string, but only the Pipedrive UI geocodes it into structured components; an API write stores the raw string.

Autocomplete (varchar_auto) fields behave like plain text on write. If a value is rejected with a type error rather than an invalid-field error, the key is right and the value shape is wrong - check the field_type from the fields endpoint and format accordingly.

  • Date: YYYY-MM-DD. Time: HH:MM:SS.
  • Monetary: amount plus {hash}_currency set to the ISO currency code.
  • Single/multi-option: numeric option ID(s), comma-separated for multi.
  • Person/org/user relation fields: the related record's numeric ID.

Reading custom field values back out

On the way back, Pipedrive returns custom field values under the same hash keys (flat on v1, nested under custom_fields on v2). To turn them into something usable downstream, join each value against the fields endpoint by key: field_type tells you how to parse it, and for option fields the options array maps the returned numeric IDs back to labels.

Build the key-to-name map once at the top of the workflow and reuse it, rather than hardcoding hashes throughout - a field deleted and recreated in Pipedrive gets a new hash, and a hardcoded reference then silently reads nothing.

Build the key map once, at the top of the workflow

Hardcoding forty-character hashes into node parameters is the practice that makes these workflows unmaintainable. The hash is meaningless to read, it cannot be reviewed, and it changes if the field is ever deleted and recreated — at which point the workflow keeps running and silently writes nothing, because Pipedrive ignores an unknown key rather than rejecting it. A single lookup at the start of the run, cached for the rest of it, removes all three problems.

Fetch the field definitions once per execution, not once per item. Pipedrive meters API usage against a daily token budget, and a metadata call inside a loop over a few thousand records is one of the easiest ways to exhaust it on work that produces no business value. One call to the relevant fields endpoint returns every field with its key, name, field_type, and, for option fields, the full options array — everything the rest of the workflow needs.

Keep the map keyed on the human name and let the rest of the workflow read like the business, not like a hash table. When something breaks, the failure then names the field that is missing instead of producing a hash that nobody can trace back to a field.

// n8n Code node, run once after a single GET /api/v2/dealFields
const fields = $json.data;

const byName = Object.fromEntries(
  fields.map((f) => [f.name, {
    key: f.key,
    type: f.field_type,
    options: Object.fromEntries((f.options || []).map((o) => [o.label, o.id]))
  }])
);

const required = ["Website", "Customer tier", "Renewal date"];
const missing = required.filter((n) => !byName[n]);
if (missing.length) throw new Error("Pipedrive fields missing: " + missing.join(", "));

return [{ json: {
  custom_fields: {
    [byName["Website"].key]: $json.site,
    [byName["Customer tier"].key]: byName["Customer tier"].options[$json.tier],
    [byName["Renewal date"].key]: $json.renewal          // YYYY-MM-DD
  }
} }];

Where these facts come from

The distinction between a custom field's display name and its internal API key, and the Company Settings → Data Fields → "Copy API Key" location, are confirmed by a resolved report on the n8n Community forum describing this exact "Invalid field(s) in the payload" error when creating a Pipedrive organization with custom properties.

Frequently asked questions

Why does Pipedrive's UI never just show me the API key directly?

The web interface is built around the human-readable label since that's what users need day to day. The internal key is only exposed through Company Settings → Data Fields → the field's three-dot menu → "Copy API Key", or by calling the fields API endpoint directly.

I copied the API key and it still fails — what else could be wrong?

Check whether the field is a dropdown or multi-select type. Those need the numeric option ID as the value, not the option's visible text — a correct field key with an incorrect option value produces a different but related validation error.

Does the API key change if I rename the custom field's display label later?

No. The internal key is generated once, when the field is created, and stays fixed even if you rename the field's visible label afterward. Renaming a field in the Pipedrive UI never requires updating any integration that already uses the correct key.

The request succeeds but the custom field is still empty.

Pipedrive ignores unknown keys instead of rejecting them, so a stale hash — from a field that was deleted and recreated — produces a clean success and no write. Resolve keys from the fields endpoint at runtime and fail loudly when an expected field name is absent.