Blog

Call the Pipedrive API From Make With a Code Step (Custom Fields, Bulk Updates)

Updated November 2026

One code step in Make can read Pipedrive's deal field definitions once, turn every 40-character custom field key into its readable name, and hand the next module a clean array of deals. The same step can update the stage of 50 deals for one Make operation instead of 50, by calling PATCH /api/v2/deals/{id} in small concurrent batches.

Make's Pipedrive app is good at the single-record cases: watch a deal, get a person, create an activity. Since Make moved the app to Pipedrive API v2 (v1 modules stopped running on July 31, 2026, per Make's app page, checked October 2026), custom fields arrive under one custom_fields object, still keyed by hashes like dcf558aac1ae4e8c4f849ba5e668430d8df9be12. Every Update a Deal call is one operation per deal, and endpoints without a module (deal field options, discounts, lead conversion) go through Make an API Call, also one operation each.

TL;DR

  • Auth is one header, x-api-token, against https://<company>.pipedrive.com/api/v2/.... Keep the token in a Make variable, not in the code.
  • GET /api/v2/dealFields returns field_code (the hash), field_name and option labels. Map once, apply to every deal.
  • Bulk stage change: one code step, 5 parallel PATCH calls at a time, 1 Make operation total.
  • Notes and most lead endpoints are still v1 only (checked October 2026). Use /api/v1/... there, same header.
  • Runs in the CustomJS Make module on every plan, including free (20 requests per day).

How do I get Pipedrive deals with readable custom field names in Make?

Add the CustomJS module Execute Inline JavaScript, set Return Type to Array, and put a JSON string in the Input field. The token comes from a Make variable; the stage ID is the stage you want to read.

{
  "token": "{{var.pipedriveToken}}",
  "company": "acme-sales",
  "stageId": 3
}

The code fetches the field definitions, builds two lookup tables (hash to name, and hash plus option ID to option label for single-option fields), then fetches the deals and rewrites each one.

const { token, company, stageId } =
  typeof input === "string" ? JSON.parse(input) : input;
const base = `https://${company}.pipedrive.com/api/v2`;

const get = async (path) => {
  const res = await fetch(base + path, { headers: { "x-api-token": token } });
  if (!res.ok) throw new Error(`${path} -> ${res.status} ${await res.text()}`);
  return (await res.json()).data;
};

// 1. Field definitions, fetched once: hash -> name, hash:optionId -> label
const names = {};
const labels = {};
for (const f of await get("/dealFields?limit=500")) {
  if (!f.is_custom_field) continue;
  names[f.field_code] = f.field_name;
  for (const o of f.options || []) labels[`${f.field_code}:${o.id}`] = o.label;
}

// 2. Deals in the stage, custom fields rewritten with readable names
const deals = await get(`/deals?stage_id=${stageId}&status=open&limit=500`);
return deals.map((d) => {
  const custom = {};
  for (const [key, val] of Object.entries(d.custom_fields || {})) {
    custom[names[key] || key] = labels[`${key}:${val}`] ?? val;
  }
  return { id: d.id, title: d.title, value: d.value, currency: d.currency, ...custom };
});

Output, with two custom fields ("Contract type" is a single-option field, "Renewal date" a date field):

[
  {
    "id": 1842,
    "title": "Acme Corp - 25 seats",
    "value": 14250,
    "currency": "EUR",
    "Contract type": "Annual",
    "Renewal date": "2027-03-01"
  },
  {
    "id": 1851,
    "title": "Northwind Traders - pilot",
    "value": 2400,
    "currency": "EUR",
    "Contract type": "Monthly",
    "Renewal date": null
  }
]

The next module sees Contract type and Renewal date in its mapping panel instead of the hash. Multi-option fields (type set) come back as arrays of option IDs; map each element through labels if you need the text. Both endpoints return at most 500 items per call; for more, loop on additional_data.next_cursor and pass it as &cursor=. The step makes two round trips to Pipedrive, so it lands well above the 121 ms median for inline scripts and usually under a second, and it costs 20 Pipedrive API tokens (10 per list call per the v2 spec).

How do I move many Pipedrive deals to a new stage in one Make operation?

Pass the deal IDs (for example from a previous Array Aggregator, turned into a JSON string) and the target stage. The loop sends five PATCH requests at a time, which stays under Pipedrive's burst limit of 20 requests per 2 seconds for API-token traffic on the smallest plan (rate limiting doc, checked October 2026).

{
  "token": "{{var.pipedriveToken}}",
  "company": "acme-sales",
  "dealIds": [1842, 1851, 1877, 1902, 1915, 1920, 1933],
  "stageId": 4
}
const { token, company, dealIds, stageId } =
  typeof input === "string" ? JSON.parse(input) : input;
const concurrency = 5; // burst limit is 20 requests per 2 s on Pipedrive's smallest plan
const results = [];

for (let i = 0; i < dealIds.length; i += concurrency) {
  const batch = dealIds.slice(i, i + concurrency).map(async (id) => {
    const res = await fetch(`https://${company}.pipedrive.com/api/v2/deals/${id}`, {
      method: "PATCH",
      headers: { "x-api-token": token, "Content-Type": "application/json" },
      body: JSON.stringify({ stage_id: stageId }),
    });
    return { id, ok: res.ok, status: res.status };
  });
  results.push(...(await Promise.all(batch)));
}

return {
  updated: results.filter((r) => r.ok).map((r) => r.id),
  failed: results.filter((r) => !r.ok),
};
{
  "updated": [1842, 1851, 1877, 1902, 1915, 1920],
  "failed": [{ "id": 1933, "ok": false, "status": 404 }]
}

Make bills this as 1 operation. Pipedrive still counts each PATCH (5 tokens per update in the v2 spec), so the daily token budget is the real ceiling, not Make's operation count. If you call the same mapping from several scenarios, store it once as an Execute Stored Function with dealIds and stageId as named parameters.

Use our Make App to execute JavaScript directly in Make.

Native Pipedrive module or code step?

TaskMake's Pipedrive appCode step
Custom field namesHash keys inside custom_fieldsReadable names from dealFields
Update 50 deals50 operations (Iterator + Update a Deal)1 operation + 1 CustomJS request
Endpoint without a moduleMake an API Call, 1 operation per callAny v1 or v2 endpoint, as many calls as the step needs
Trigger on a new dealWatch Deals moduleNot possible, code steps do not trigger
MaintenanceMake updates the appYou own 25 lines of code

When Make's built-in is enough

  • One deal per scenario run. A webhook-triggered Update a Deal costs 1 operation, the same as a code step, and needs no token handling.
  • Triggers. Only the Pipedrive app can watch deals, persons or activities; a code step cannot start a scenario.
  • You already know the two or three hash keys you need. Copy them from Settings, Data fields, Copy API key, and map them directly.
  • A single endpoint call that Make has no module for. Make an API Call does it in one operation with the connection you already have.
  • Teammates who will not read JavaScript maintain the scenario. A visible module is easier to hand over than a code block.

For the related document workflow (fetch a deal, render a quote PDF, attach it back to the deal), see Pipedrive PDF quotes: 3 ways to generate documents from deal data. The HubSpot recipe uses the same fetch pattern with a different auth header.

The CustomJS Make module runs this code on every plan, including the free tier (20 requests per day, no credit card), with fetch and the pipedrive npm package preinstalled.

Run the Pipedrive snippet in Make

Frequently Asked Questions

Related Articles

Continue reading on similar topics