Skip to main content

Pipedrive

Pipedrive is a CRM SaaS platform that helps you manage your contacts, deals, leads, etc.

Credential configuration

To configure this credential you only need the Pipedrive API token. You can know how to find it here.

Here you have an example of a filled credential configuration form in YepCode:

Pipedrive snippets available in editor

note

The title is the triggering text for YepCode to autocomplete the script

Integration

New integration from credential
const pipedrive = yepcode.integration.pipedrive("credential-slug");
New integration from plain authentication data
const pipedrive = require("pipedrive");

const client = pipedrive.ApiClient.instance;
client.authentications.api_key.apiKey = "your-api-token";
tip

Find the complete pipedrive API reference here: https://developers.pipedrive.com/docs/api/v1

Create lead

Create lead
const leadsApi = new pipedrive.LeadsApi();

leadsApi
.addLead({
title: "lead-title",
person_id: person-id,
organization_id: organization-id
})
.then((response) => {
console.log(`Created lead with id ${response.data.id}`)
})
.catch(console.error);

List leads

List leads
const leadsApi = new pipedrive.LeadsApi();

leadsApi.getLeads().then((response) => {
const leads = response.data
leads.forEach((lead) => {
console.log(`Found lead with id ${lead.id} and title ${lead.title}`)
})
}).catch(console.error);

Delete lead

Delete lead
const leadsApi = new pipedrive.LeadsApi();

leadsApi.deleteLead("lead-id").then((response) => {
console.log(`Deleted lead widh id: ${response.data.id}`)
}).catch(console.error);

Create contact

Create contact
const personsApi = new pipedrive.PersonsApi();

personsApi
.addPerson({
name: "contact-name",
email: ["contact-email"],
org_id: organization-id,
})
.then((response) => {
console.log(
`Created person widh id: ${response.data.id} and name ${response.data.name}`
);
})
.catch(console.error);

List contacts

List contacts
const personsApi = new pipedrive.PersonsApi();

personsApi.getPersons().then((response) => {
const persons = response.data;
persons.forEach((person) => {
console.log(`Found person with id ${person.id} and name ${person.name}`)
})
}).catch(console.error);

Delete contact

Delete contact
const personsApi = new pipedrive.PersonsApi();

personsApi.deletePerson(person-id).then((response) => {
console.log(`Deleted person widh id: ${response.data.id}`)
}).catch(console.error);

Create organization

Create organization
const organizationsApi = new pipedrive.OrganizationsApi();

organizationsApi
.addOrganization({ name: "organization-name" })
.then((response) => {
console.log(
`Created organization widh id: ${response.data.id} and name ${response.data.name}`
);
})
.catch(console.error);

List organizations

List organizations
const organizationsApi = new pipedrive.OrganizationsApi();

organizationsApi.getOrganizations().then((response) => {
response.data.forEach((organization) => {
console.log(`Found organization with id ${organization.id} and name ${organization.name}`)
})
}).catch(console.error);

Delete organization

Delete organization
const organizationsApi = new pipedrive.OrganizationsApi();

organizationsApi.deleteOrganization(organization-id).then((response) => {
console.log(`Deleted organization widh id: ${response.data.id}`)
}).catch(console.error);