> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withampersand.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pipedrive

## What's Supported

### Supported Actions

This connector supports:

* [Read Actions](/read-actions) including full historic backfill. Incremental read is supported for select objects using the v2 API (see [v2 API Objects](#v2-api-objects) below). For all other objects, a full read of the Pipedrive instance will be done for each scheduled read.
* [Write Actions](/write-actions)
* [Proxy Actions](/proxy-actions), using the base URL `https://api.pipedrive.com`.

Pipedrive has a v1 and v2 API, if you would like to opt into the v2 API, then add `module: crm` to your amp.yaml file. Otherwise, v1 API is used. You can learn more about the difference between v1 and v2 API in [Pipedrive documentation](https://pipedrive.readme.io/docs/pipedrive-api-v2-migration-guide).

```yaml theme={null}
specVersion: 1.0.0
integrations:
  - name: read-write-pipedrive
    provider: pipedrive
    module: "crm" # The CRM module uses v2 APIs
```

### Supported Objects for V2 API

The Pipedrive connector supports reading and writing to the following objects.

| Object                                                                      | Incremental Read |
| --------------------------------------------------------------------------- | :--------------: |
| [Activities](https://developers.pipedrive.com/docs/api/v1/Activities)       |        Yes       |
| [Deals](https://developers.pipedrive.com/docs/api/v1/Deals)                 |        Yes       |
| [Organizations](https://developers.pipedrive.com/docs/api/v1/Organizations) |        Yes       |
| [Persons](https://developers.pipedrive.com/docs/api/v1/Persons)             |        Yes       |
| [Pipelines](https://developers.pipedrive.com/docs/api/v1/Pipelines)         |        No        |
| [Products](https://developers.pipedrive.com/docs/api/v1/Products)           |        No        |
| [Stages](https://developers.pipedrive.com/docs/api/v1/Stages)               |        No        |

#### Reading Deal Products

If you would like to read Products associated with Deals, add `products` as a field in `deals`.

```yaml theme={null}
specVersion: 1.0.0
integrations:
  - name: read-write-pipedrive
    provider: pipedrive
    # The CRM module uses v2 APIs, which is required for to read deal products
    module: "crm"
    read:
      objects:
        - objectName: deals
          destination: pipedrive-webhook
          schedule: "*/10 * * * *" # Every 10 minutes
          requiredFields:
            - fieldName: id
            - fieldName: products # Add products as a field
```

#### Example Integration

For an example manifest file of a Pipedrive v2 integration, visit our [samples repo on Github](https://github.com/amp-labs/samples/blob/main/pipedrive/v2/amp.yaml).

### Supported Objects for V1 API

The Pipedrive connector supports reading from the following objects using the v1 API:

* [Activities](https://developers.pipedrive.com/docs/api/v1/Activities#getActivities)
* [Activity Fields](https://developers.pipedrive.com/docs/api/v1/ActivityFields#getActivityFields)
* [Activity Types](https://developers.pipedrive.com/docs/api/v1/ActivityTypes#getActivityTypes)
* [Call Logs](https://developers.pipedrive.com/docs/api/v1/CallLogs#getUserCallLogs)
* [Currencies](https://developers.pipedrive.com/docs/api/v1/Currencies#getCurrencies)
* [Deals](https://developers.pipedrive.com/docs/api/v1/Deals#getDeals)
* [Deal Fields](https://developers.pipedrive.com/docs/api/v1/DealFields#getDealFields)
* [Files](https://developers.pipedrive.com/docs/api/v1/Files#getFiles)
* [Filters](https://developers.pipedrive.com/docs/api/v1/Filters#getFilters)
* [Leads](https://developers.pipedrive.com/docs/api/v1/Leads#getLeads)
* [Lead Labels](https://developers.pipedrive.com/docs/api/v1/LeadLabels#getLeadLabels)
* [Lead Sources](https://developers.pipedrive.com/docs/api/v1/LeadSources#getLeadSources)
* [LegacyTeams](https://developers.pipedrive.com/docs/api/v1/LegacyTeams#getTeams)
* [Notes](https://developers.pipedrive.com/docs/api/v1/Notes#getNotes)
* [Note Fields](https://developers.pipedrive.com/docs/api/v1/NoteFields#getNoteFields)
* [Organizations](https://developers.pipedrive.com/docs/api/v1/Organizations#getOrganizations)
* [Organization Fields](https://developers.pipedrive.com/docs/api/v1/OrganizationFields)
* [Organization Relationships](https://developers.pipedrive.com/docs/api/v1/OrganizationRelationships#getOrganizationRelationships)
* [Permission Sets](https://developers.pipedrive.com/docs/api/v1/PermissionSets#getPermissionSets)
* [Persons](https://developers.pipedrive.com/docs/api/v1/Persons#getPersons)
* [Person Fields](https://developers.pipedrive.com/docs/api/v1/PersonFields#getPersonFields)
* [Pipelines](https://developers.pipedrive.com/docs/api/v1/Pipelines#getPipeline)
* [Products](https://developers.pipedrive.com/docs/api/v1/Products#getProducts)
* [Product Fields](https://developers.pipedrive.com/docs/api/v1/ProductFields#getProductFields)
* [Projects](https://developers.pipedrive.com/docs/api/v1/Projects#getProjects)
* [Project Templates](https://developers.pipedrive.com/docs/api/v1/ProjectTemplates#getProjectTemplates)
* [Recents](https://developers.pipedrive.com/docs/api/v1/Recents#getRecents)
* [Roles](https://developers.pipedrive.com/docs/api/v1/Roles#getRoles)
* [Stages](https://developers.pipedrive.com/docs/api/v1/Stages#getStages)
* [Tasks](https://developers.pipedrive.com/docs/api/v1/Tasks#getTasks)
* [Users](https://developers.pipedrive.com/docs/api/v1/Users#getUsers)
* [User Connections](https://developers.pipedrive.com/docs/api/v1/UserConnections#getUserConnections)
* [User Settings](https://developers.pipedrive.com/docs/api/v1/UserSettings#getUserSettings)
* [Webhooks](https://developers.pipedrive.com/docs/api/v1/Webhooks#getWebhooks)

The Pipedrive connector supports writing to the following objects:

* [Activities](https://developers.pipedrive.com/docs/api/v1/Activities#addActivity)
* [Activity Types](https://developers.pipedrive.com/docs/api/v1/ActivityTypes#addActivityType)
* [Call Logs](https://developers.pipedrive.com/docs/api/v1/CallLogs#addCallLog)
* [Channels](https://developers.pipedrive.com/docs/api/v1/Channels#addChannel)
* [Currencies](https://developers.pipedrive.com/docs/api/v1/Currencies)
* [Deals](https://developers.pipedrive.com/docs/api/v1/Deals#getDeals)
* [Deal Fields](https://developers.pipedrive.com/docs/api/v1/DealFields#addDealField)
* [Files](https://developers.pipedrive.com/docs/api/v1/Files#addFile)
* [Filters](https://developers.pipedrive.com/docs/api/v1/Filters#addFilter)
* [Leads](https://developers.pipedrive.com/docs/api/v1/Leads#addLead)
* [Lead Labels](https://developers.pipedrive.com/docs/api/v1/LeadLabels#addLeadLabel)
* [legacy Teams](https://developers.pipedrive.com/docs/api/v1/LegacyTeams#addTeam)
* [Notes](https://developers.pipedrive.com/docs/api/v1/Notes#addNote)
* [Organizations](https://developers.pipedrive.com/docs/api/v1/Organizations#addOrganization)
* [Organization Fields](https://developers.pipedrive.com/docs/api/v1/OrganizationFields#addOrganizationField)
* [Organization Relationship](https://developers.pipedrive.com/docs/api/v1/OrganizationRelationships#addOrganizationRelationship)
* [Person](https://developers.pipedrive.com/docs/api/v1/Persons#addPerson)
* [Person Fields](https://developers.pipedrive.com/docs/api/v1/PersonFields#addPersonField)
* [Pipelines](https://developers.pipedrive.com/docs/api/v1/Pipelines#addPipeline)
* [Products](https://developers.pipedrive.com/docs/api/v1/Products#addProduct)
* [Product Fields](https://developers.pipedrive.com/docs/api/v1/ProductFields#addProductField)
* [Projects](https://developers.pipedrive.com/docs/api/v1/Projects#addProject)
* [Roles](https://developers.pipedrive.com/docs/api/v1/Roles#addRole)
* [Stages](https://developers.pipedrive.com/docs/api/v1/Stages#addStage)
* [Tasks](https://developers.pipedrive.com/docs/api/v1/Tasks#addTask)
* [Users](https://developers.pipedrive.com/docs/api/v1/Users#addUser)
* [Webhooks](https://developers.pipedrive.com/docs/api/v1/Webhooks#addWebhook)

#### Example Integration

For an example manifest file of a Pipedrive v1 integration, visit our [samples repo on Github](https://github.com/amp-labs/samples/blob/main/pipedrive/v1/amp.yaml).

## Before You Get Started

To integrate Pipedrive with Ampersand, you will need [a Pipedrive Account](https://www.pipedrive.com/signup).

Once your account is created, you'll need to create an app in Pipedrive, configure the Ampersand redirect URI within the app, and obtain the following credentials from your app:

* OAuth Client ID
* OAuth Client Secret

You will then use these credentials to connect your application to Ampersand.

### Create a Pipedrive Account

Here's how you can sign up for a Pipedrive account:

* Go to the [Pipedrive Sign Up page](https://www.pipedrive.com/signup).
* Sign up using your preferred method.

### Creating a Pipedrive App

Follow the steps below to create a Pipedrive app and add the Ampersand redirect URL.

1. Log in to your [Pipedrive](https://app.pipedrive.com/login) account.
2. Go to [Developer Hub](https://marketplace.pipedrive.com/app/manage).
3. Click the **Create an app** button.
4. Select **Create private app**.
5. Enter the following app details:
   * **App Name**: The name of your app.
   * **Callback URL**: Enter the Ampersand redirect URL: `https://api.withampersand.com/callbacks/v1/oauth`.
6. In the **OAuth and access scopes** section, select the relevant scopes for your app.
7. Click **Save**.

<img src="https://mintcdn.com/ampersand-24eb5c1a/Bx3tggG51e0liOp-/images/provider-guides/8f40494-pipeline1.gif?s=33ce92604e40d09bf5c417f8fc2e5cf4" alt="Alt text" width="1440" height="682" data-path="images/provider-guides/8f40494-pipeline1.gif" />

In the \*\*Client ID \*\*section of **OAuth and access scopes**, you will find the **Client ID** and **Client Secret** keys. Note these keys, as they are essential for connecting your app to Ampersand.

<img src="https://mintcdn.com/ampersand-24eb5c1a/p4alBfPjHeNuBPh1/images/provider-guides/2799bb2-Screenshot_2024-07-08_at_21.14.56.png?fit=max&auto=format&n=p4alBfPjHeNuBPh1&q=85&s=da6b1834495bb822de4bb11258ebf5a1" alt="Alt text" width="2258" height="440" data-path="images/provider-guides/2799bb2-Screenshot_2024-07-08_at_21.14.56.png" />

## Add Your Pipedrive App Info to Ampersand

1. Log in to your [Ampersand Dashboard](https://dashboard.withampersand.com).

2. Select the project where you want to create a Pipedrive integration.

   <img src="https://mintcdn.com/ampersand-24eb5c1a/CkzFg-K1u4gYx3ZD/images/provider-guides/dd47b7a-Ampersand.png?fit=max&auto=format&n=CkzFg-K1u4gYx3ZD&q=85&s=d580aa00cc421fe14cfbab79c2e0812f" alt="Alt text" width="2244" height="442" data-path="images/provider-guides/dd47b7a-Ampersand.png" />

3. Select **Provider Apps**.

4. Select *Pipedrive* from the **Provider** list.

5. Enter the previously obtained *Client ID* in the **Client ID** field and *Client Secret* in the **Client Secret** field.

6. Click **Save Changes**.
