Dograh

How to Connect a Voice Agent to Pipedrive: Leads and Activities

How to Connect a Voice Agent to Pipedrive: Leads and Activities
TutorialDecember 4, 2026·10 min read

How to Connect a Voice Agent to Pipedrive: Leads and Activities

Abhishek Kumar
Abhishek Kumar·Co-founder, Dograh AI

Co-founder of Dograh, building the future of open-source voice AI agents. Own your voice AI stack.

To connect a voice agent to Pipedrive, send your API token in the x-api-token header and give the agent HTTP API tools that match callers and create leads or activities. In Dograh, the open-source AI voice agent platform, the token sits in one credential that every tool shares, whether you self-host it or use Dograh Cloud.

Key Takeaways

  • Pipedrive allows one active API token per user, so give the agent its own user.
  • Person search allows 10 requests per 2 seconds, on every Pipedrive plan.
  • Leads need a linked person or organization, so match the caller before creating one.

A sales rep who opens Pipedrive in the morning should see every call the agent took. Below we connect the two step by step in Dograh, our open-source AI voice agent platform, from the API token to logged outcomes. Then we plan for Pipedrive's API limits.

What you need before you start

These steps follow the published Dograh and Pipedrive docs. Run them on a trial server before production, against a Pipedrive sandbox or trial company, so a test call never creates a lead your sales team chases.

You need a Pipedrive user whose API token the agent will use, a Dograh agent that passes a browser test call and a small endpoint of your own for the after-call log. Our guide to connecting a voice agent to your CRM explains why that endpoint, which it calls the bridge, sits between the agent and the CRM after the call.

Pipedrive plugs in through the HTTP API tools, Pre-Call Data Fetch and Webhook node you configure in Dograh, rather than a built-in connector. If your team only needs each call logged as an activity, a phone system with a Pipedrive app can do that with no code. The steps below fit when the agent should know who is calling and create something in Pipedrive while the caller is still on the line.

Check: you can sign in to the sandbox company, and the agent answers a browser test call.

Step 1: Put the Pipedrive API token in a credential

Pipedrive's API token is fixed, so it can go straight into Dograh. In Pipedrive, open your account name at the top right, then Company settings, Personal preferences and API, where the API token sits. The token acts as that user, and every lead and activity the agent creates is made in their name. That is why a dedicated Pipedrive user for the agent is the better choice.

Pipedrive reads the token from the x-api-token header on every request, and you can have only one active token at a time. Changing it breaks every integration that uses the old one. In Dograh, open Credentials in the sidebar, click Add Credential, pick API Key as the Credential Type, set Header Name to x-api-token and paste the token into API Key.

Check: the credential shows under Credentials with the type API Key.

Step 2: Match the caller by phone

The agent's first job is to find out whether Pipedrive already knows the caller. Open Tools, click Create New Tool and pick External HTTP API. Name it find_person, set HTTP Method to GET and Endpoint URL to https://api.pipedrive.com/api/v2/persons/search, and pick the API Key credential on the Authentication tab.

On the Parameters tab, add four Preset Parameters, so the agent never has to type a number. term takes {{initial_context.caller_number}}, fields is phone, exact_match is the Boolean true and limit is the Number 1. A GET tool sends these as query parameters, so the request asks Pipedrive for the one person whose phone field matches the caller's number. The reply is a short list, and the id of the first item is the person ID the next tools need.

Phone formats matter here. An exact match compares the stored text, so a number saved as "(415) 555-..." may not match +1415555XXXX. Store numbers in one format, with the country code, or drop exact_match and let your endpoint compare the digits. Note too that caller_number is the caller on inbound calls, while on an outbound campaign it is your own caller ID, so outbound calls should carry the Pipedrive person ID as a column in the campaign file instead.

If you want the caller's name before the greeting, Pre-Call Data Fetch at the bottom of the Start Call node sends a POST with the caller's details to an endpoint you run, which can make the same search. Either way, a phone match finds a record, and it does not prove who is calling, so the agent confirms an approved detail before it discusses any deal.

Check: Test Tool with a test person's number returns that person's ID.

Dograh

Open Source Alternative to Vapi / Retell

Self-hosted voice agent platform — no per-minute fees

dograh-hq/dograh

Star on GitHub

Step 3: Create a lead or an activity during the call

Pick the object that matches what the caller wants. A lead is a new possible deal, which suits a caller asking for a demo or a quote. An activity is a task on someone's calendar, which suits a caller asking for a callback on a set day. Each gets its own tool, with POST and the API Key credential.

Two callers talk to the agent, one who wants a demo and one who wants a callback. The agent's requests go to Pipedrive with the team's API token. The demo request becomes a lead card in a leads tray, linked to the caller, and the callback request becomes a call task on a rep's calendar for the agreed date.
Matching the record to the request keeps sales work in the right place, with demo interest waiting as a lead and promised calls showing up on a rep's day. Each request is its own tool, so the agent never has to guess which form to fill.

For leads, set Endpoint URL to https://api.pipedrive.com/v1/leads. Pipedrive requires every lead from the API to link to a person or an organization, so add an LLM Parameter pipedrive_person_id of type Number, filled from find_person's reply, and an LLM Parameter lead_title. Then switch on Tool Body Template:

{
  "title": "{{lead_title}}",
  "person_id": "{{pipedrive_person_id}}"
}

What this does: It creates a lead linked to the caller, which Pipedrive marks with the source API. Because person_id is exactly one placeholder of type Number, it arrives as a number, not as text.

For activities, use https://api.pipedrive.com/api/v2/activities. In v2 the person goes in through participants, because the activity request does not take person_id on its own. Add LLM Parameters for callback_date (in YYYY-MM-DD form) and callback_reason, plus the same pipedrive_person_id:

{
  "subject": "Callback requested by voice agent",
  "type": "call",
  "due_date": "{{callback_date}}",
  "participants": [{ "person_id": "{{pipedrive_person_id}}", "primary": true }],
  "note": "{{callback_reason}}"
}

What this does: It puts a call task on the calendar for the agreed date, linked to the caller as the primary participant. type must be an activity type key your account has, and call is one most accounts keep.

When the caller is new, find_person returns nothing, so the prompt either adds the person first with a third tool or takes the details for a rep. In each tool's Messages card, add a line under When the tool starts, such as "I'm setting that up for you now." The tools wait 5 seconds by default and do not retry, so the prompt also says what the agent tells the caller on an error. Our post on voice agent tool calls covers attaching tools to a node.

Check: a test call that asks for a demo creates one lead, and one that asks for a callback creates one activity on the right date.

Step 4: Log the outcome after the call

Every call should leave a trace in Pipedrive, even when nothing was created during it. A Webhook node does this once the call ends. Send it to your endpoint, not to Pipedrive, because Dograh retries temporary failures, up to five attempts in all, and a retried create would add a second activity. Dograh also adds a top-level call_disposition key to any payload that does not set one, which your endpoint can map or ignore.

Select Add node on the canvas, add a Webhook node, set HTTP Method to POST and Endpoint URL to your endpoint, and use this Payload Template:

{
  "call_id": "{{workflow_run_id}}",
  "person_id": "{{gathered_context.pipedrive_person_id}}",
  "outcome": "{{gathered_context.call_disposition}}",
  "summary": "{{gathered_context.call_summary}}",
  "duration_seconds": "{{cost_info.call_duration_seconds}}"
}

What this does: It sends one object per finished call. Your endpoint checks call_id first, then adds a done activity of type call with the outcome as the subject and the summary as the note, linked to the person through participants.

pipedrive_person_id and call_summary reach the payload through variable extraction, so switch on Enable Variable Extraction on the node and add both with an Extraction Hint. The summary is an AI-written account of the call, and the recording remains the exact record when a rep needs the detail. Our post on extracting call data into your CRM covers outcome codes that a sales team can filter on. If Pipedrive refuses the activity, the endpoint retries a set number of times, then flags it for a person.

Check: after two test calls, the person shows two done call activities, and a repeated delivery of the same call adds nothing.

Join the Dograh Community

Dograh is an OSS alternative to Vapi. Join our Slack community for queries, releases, best practices & community interactions.

Step 5: Budget for Pipedrive's token limits

Pipedrive meters its API in tokens, and each request type has its own cost. Pipedrive gives each company a daily budget of 30,000 base tokens times a plan multiplier times the number of seats, with multipliers of 1 on Lite, 2 on Growth, 5 on Premium and 7 on Ultimate. Each request costs tokens by type. A person search costs 20 tokens, a new lead 10 and a new v2 activity 5.

Our own worked example puts numbers on it. A Growth company with 3 seats has 30,000 times 2 times 3, which is 180,000 tokens a day. A call that searches, adds a lead and logs an activity uses 35, so the budget covers about 5,140 such calls a day. The daily budget is rarely the problem. The Search API allows only 10 requests per 2 seconds on every plan, so if 12 callers connect in the same second, 2 searches are refused until the window passes, and those callers are greeted without a match.

So keep searches out of calls that do not need them. Outbound calls with the person ID in the campaign file make no search at all, and an endpoint that caches recent callers saves another.

Leads still live on Pipedrive's v1 API. When Pipedrive replaces a v1 API with a v2 version, it gives at least a year's grace before the old one goes, so if leads move to v2 you will have time to switch.

Check: your endpoint logs the token cost of each call, and the total stays well inside the daily budget.

Before you ship it

Place three test calls by phone, from a known person, from a number Pipedrive has never seen and from a known person saved in another number format. Check that the first gets a match, the second gets the new-caller path and the third shows you whether your phone format rule holds.

Keep private data where it belongs. Dograh's recording and transcript links open without a login, so leave them out of the payload unless your team needs them, and never paste them into a note a wide group can read. Send the fewest fields that make the activity useful.

If you self-host Dograh, the API token, your endpoint and every call record live on your servers. The speech and language providers you pick still receive what they process, and Pipedrive sees only the fields your tools and Webhook node send. Start with inbound calls on the sandbox, and switch to the live company once a week of activities reads cleanly.

Glossary

x-api-token
The header Pipedrive reads the API token from on every request. In Dograh it is the Header Name of an API Key credential.
Exact match
A Pipedrive search option that returns only records whose field equals the search term, so a phone search must use the same number format as the stored value.
Participants
The v2 activity field that links people to an activity. The person marked primary is the one the activity belongs to.
Token budget
Pipedrive's daily API allowance, 30,000 base tokens times the plan multiplier times seats, spent at a different cost per request type.

Frequently Asked Questions

Get started with Dograh

Build, deploy, and scale AI agents with Dograh. Join the community of developers building the future.