# Actions Pipedrive

The Actions Pipedrive destination allows customers to share Segment event data with Pipedrive. Segment events sent to Pipedrive will either create new Entities or update existing Entities in Pipedrive.

## Benefits of Actions Pipedrive

Actions Pipedrive provides the following benefits:

* **Clear mapping of data**. Actions-based destinations enable you to define the mapping between the data Segment receives from your source and the data Segment sends to Pipedrive.
* **Maximum event measurement**. Capture more events with improved accuracy across different browsers, apps, and devices to get a unified view of your customer's journey from page view to purchase.

## Getting started

1. Sign in to your Segment Workspace
2. Click to the **Catalog** tab.
3. Click on the **Destinations** tab.
4. Use the search field to find the 'Pipedrive' destination. Click on the **Actions Pipedrive** tile.
5. Click **Add Destination**.
6. Select a source to connect to and click the **Next** button.
7. Provide a name for your Pipedrive destination and click the **Create Destination** button.
8. On the Settings tab, provide values in the **Domain** and **API Token** settings fields, then click the **Save Changes** button.
9. Navigate to the **Mappings** tab to configure how Segment events will be mapped to Pipedrive Entities. By default, mappings to upsert to Pipedrive's Person, Organization and Activity Entities will already be enabled. You can configure new Mappings by clicking on the **New Mapping** button.
10. After you've configured and enabled your Mappings, click back to the **Settings** tab and enable the integration using the **Enable Destination** toggle. Segment should now start sending event data to Pipedrive.

## Inserting new Entities compared to updating existing Entities

Segment uses the **Match value** field value as a key when creating or updating an Entity in Pipedrive. By default, the **Match value** will be mapped to the **id** field for the corresponding Entity. You can specify which Pipedrive field to use as a key using the **Match field** field.

**Match field** fields are dynamic and will populate with data from your Pipedrive account.

![Mapping Segment fields to Pipedrive entities, showing options like ID, Name, and Email.](https://docs-resources.prod.twilio.com/4e052d9f886953995f4fe03951d2e31843f9613683b79417ba60c96637c956dd.png)

In the following example, Segment is configured to create or update Person Entities using the email field.

![Mappings configuration to Actions Pipedrive where 'traits.email' is mapped to Match value and 'Email' is mapped to Match field.](https://docs-resources.prod.twilio.com/23f3d8127f437f81d4f06bf4dafe29a0de5ff324c6cac08c2ed9ac6a55e684a4.png)

## Associating Entities with other Entities

Entities such as the **Deal** Entity can be configured to be associated with other Entities in Pipedrive. In the example with the **Deal** mapping below the following will happen:

1. A **Person** Entity with an email address matching **properties.email** will be associated with the **Deal** Entity being created or updated.
2. An **Organization** Entity with an ID matching **properties.org\_id** will be assocated with the **Deal** Entity being created or updated.

![Mappings configuration to Actions Pipedrive where entities are mapped to other entities.](https://docs-resources.prod.twilio.com/74625ccf9d4bf4b09d3f37ae57c63841582497ce889d03e3632b788d8357d881.png)

## Destination Settings

| Field                                              | Description                                                                                                                                                                           | Required | Type     |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- |
| API Token                                          | Pipedrive API token. This is found in Pipedrive in Settings > Personal preferences > API > Your personal API token.                                                                   | Yes      | password |
| External ID field for a Deal in Pipedrive          | This is a key by which a Deal in Pipedrive will be searched. It can be either Deal id or has of a custom field containing external id. Default value is \`deal\_id\`.                 | No       | string   |
| Domain                                             | Pipedrive domain. This is found in Pipedrive in Settings > Company settings > Company domain.                                                                                         | Yes      | string   |
| External ID field for an Organization in Pipedrive | This is a key by which an Organization in Pipedrive will be searched. It can be either Organization id or has of a custom field containing external id. Default value is \`org\_id\`. | No       | string   |
| External ID field for a Person in Pipedrive        | This is a key by which a Person in Pipedrive will be searched. It can be either Person id or has of a custom field containing external id. Default value is \`person\_id\`.           | No       | string   |

## Available Presets

Actions Pipedrive has the following presets

| Preset Name                      | Trigger                                              | Default Action                |
| -------------------------------- | ---------------------------------------------------- | ----------------------------- |
| Create or Update an Organization | Event type = "group"                                 | Create or Update Organization |
| Create or Update an Activity     | Event type = "track" and event = "Activity Upserted" | Create or update an Activity  |
| Create or Update a Person        | Event type = "identify"                              | Create or Update Person       |

## Available Actions

Build your own Mappings. Combine supported [triggers](/docs/segment/connections/destinations/actions/#components-of-a-destination-action) with the following Actions Pipedrive-supported actions:

> \[!NOTE]
>
> Individual destination instances have support a maximum of 50 mappings.

* [Create or Update Person](#create-or-update-person)
* [Create or Update Organization](#create-or-update-organization)
* [Create or update an Activity](#create-or-update-an-activity)
* [Create or update Lead](#create-or-update-lead)
* [Create or update a Note](#create-or-update-a-note)
* [Create or update a Deal](#create-or-update-a-deal)

### Create or Update Person

Update a person in Pipedrive or create them if they don't exist yet.

Create or Update Person is a **Cloud** action. The default Trigger is `type = "identify"`

| Field         | Description                                                                                                                                                                                                                                                           | Required | Type     |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- |
| Match field   | If present, used instead of field in settings to find existing person in Pipedrive.                                                                                                                                                                                   | No       | STRING   |
| Match value   | Value to find existing person by                                                                                                                                                                                                                                      | Yes      | STRING   |
| Person Name   | Name of the person                                                                                                                                                                                                                                                    | No       | STRING   |
| Email Address | Email addresses for this person.                                                                                                                                                                                                                                      | No       | STRING   |
| Phone Number  | Phone numbers for the person.                                                                                                                                                                                                                                         | No       | STRING   |
| Visible To    | Visibility of the Person. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user. 'Owner's visibility group and sub-groups' and 'Entire company' options only available with Professional or Enterprise plans | No       | STRING   |
| Created At    | If the person is created, use this timestamp as the creation timestamp. Format: YYY-MM-DD HH:MM:SS                                                                                                                                                                    | No       | DATETIME |
| Custom fields | New values for custom fields.                                                                                                                                                                                                                                         | No       | OBJECT   |

### Create or Update Organization

Update an organization in Pipedrive or create it if it doesn't exist yet.

Create or Update Organization is a **Cloud** action. The default Trigger is `type = "group"`

| Field             | Description                                                                                                                                                                                                                                                                 | Required | Type     |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- |
| Match field       | If present, used instead of field in settings to find existing organization in Pipedrive.                                                                                                                                                                                   | No       | STRING   |
| Match value       | Value to find existing organization by                                                                                                                                                                                                                                      | Yes      | STRING   |
| Organization Name | Name of the organization                                                                                                                                                                                                                                                    | No       | STRING   |
| Visible To        | Visibility of the Organization. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user. 'Owner's visibility group and sub-groups' and 'Entire company' options only available with Professional or Enterprise plans | No       | STRING   |
| Created At        | If the organization is created, use this timestamp as the creation timestamp. Format: YYY-MM-DD HH:MM:SS                                                                                                                                                                    | No       | DATETIME |
| Custom fields     | New values for custom fields.                                                                                                                                                                                                                                               | No       | OBJECT   |

### Create or update an Activity

Update an Activity in Pipedrive or create one if it doesn't exist.

Create or update an Activity is a **Cloud** action. The default Trigger is `type = "track" and event = "Activity Upserted"`

| Field                    | Description                                                                                                                                                                                     | Required | Type    |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| Activity ID              | ID of Activity in Pipedrive to Update. If left empty, a new one will be created                                                                                                                 | No       | INTEGER |
| Person match field       | If present, used instead of field in settings to find existing person in Pipedrive.                                                                                                             | No       | STRING  |
| Person match value       | Value to find existing person by                                                                                                                                                                | No       | STRING  |
| Organization match field | If present, used instead of field in settings to find existing organization in Pipedrive.                                                                                                       | No       | STRING  |
| Organization match value | Value to find existing organization by                                                                                                                                                          | No       | STRING  |
| Deal match field         | If present, used instead of field in settings to find existing deal in Pipedrive.                                                                                                               | No       | STRING  |
| Deal match value         | Value to find existing deal by                                                                                                                                                                  | No       | STRING  |
| Activity Subject         | Subject of the Activity. When value for subject is not set, it will be given a default value \`Call\`.                                                                                          | No       | STRING  |
| Type                     | Type of the Activity. This is in correlation with the key\_string parameter of ActivityTypes. When value for type is not set, it will be given a default value \`Call\`                         | No       | STRING  |
| Description              | Additional details about the Activity that is synced to your external calendar. Unlike the note added to the Activity, the description is publicly visible to any guests added to the Activity. | No       | STRING  |
| Note                     | Note of the Activity (Accepts plain text and HTML)                                                                                                                                              | No       | STRING  |
| Due Date                 | Due date of the Activity. Format: YYYY-MM-DD                                                                                                                                                    | No       | STRING  |
| Due Time                 | Due time of the Activity. Format: HH:MM                                                                                                                                                         | No       | STRING  |
| Duration                 | Duration of the Activity. Format: HH:MM                                                                                                                                                         | No       | STRING  |
| Done                     | Whether the Activity is done or not.                                                                                                                                                            | No       | BOOLEAN |

### Create or update Lead

Update a Lead in Pipedrive or create it if it doesn't exist yet.

Create or update Lead is a **Cloud** action. The default Trigger is `type = "identify"`

| Field                    | Description                                                                                                                                                                                                                                                         | Required | Type   |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| Lead ID                  | ID of Lead in Pipedrive to Update. If left empty, a new one will be created                                                                                                                                                                                         | No       | STRING |
| Person match field       | If present, used instead of field in settings to find existing person in Pipedrive.                                                                                                                                                                                 | No       | STRING |
| Person match value       | Value to find existing person by. Required unless organization\_match\_value present                                                                                                                                                                                | No       | STRING |
| Organization match field | If present, used instead of field in settings to find existing organization in Pipedrive.                                                                                                                                                                           | No       | STRING |
| Organization match value | Value to find existing organization by. Required unless person\_match\_value present                                                                                                                                                                                | No       | STRING |
| Title                    | The name of the Lead                                                                                                                                                                                                                                                | Yes      | STRING |
| Amount                   | Potential value of the lead                                                                                                                                                                                                                                         | No       | NUMBER |
| Currency                 | Three-letter code of the currency, e.g. USD                                                                                                                                                                                                                         | No       | STRING |
| Expected Close Date      | The date of when the Deal which will be created from the Lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD.                                                                                                                                             | No       | STRING |
| Visible To               | Visibility of the Lead. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user. 'Owner's visibility group and sub-groups' and 'Entire company' options only available with Professional or Enterprise plans | No       | STRING |

### Create or update a Note

Update a Note in Pipedrive or create it if it doesn't exist yet.

Create or update a Note is a **Cloud** action. The default Trigger is `type = "track" and event = "Note Upserted"`

| Field                    | Description                                                                                       | Required | Type    |
| ------------------------ | ------------------------------------------------------------------------------------------------- | -------- | ------- |
| Note ID                  | ID of Note in Pipedrive to Update. If left empty, a new one will be created                       | No       | INTEGER |
| Lead ID                  | ID of Lead in Pipedrive to link to. One of Lead, Person, Organization or Deal must be linked!     | No       | STRING  |
| Person match field       | If present, used instead of field in settings to find existing person in Pipedrive.               | No       | STRING  |
| Person match value       | Value to find existing person by. One of Lead, Person, Organization or Deal must be linked!       | No       | STRING  |
| Organization match field | If present, used instead of field in settings to find existing organization in Pipedrive.         | No       | STRING  |
| Organization match value | Value to find existing organization by. One of Lead, Person, Organization or Deal must be linked! | No       | STRING  |
| Deal match field         | If present, used instead of field in settings to find existing deal in Pipedrive.                 | No       | STRING  |
| Deal match value         | Value to find existing deal by. One of Lead, Person, Organization or Deal must be linked!         | No       | STRING  |
| Note Content             | Content of the note in text or HTML format. Subject to sanitization on the back-end.              | Yes      | STRING  |

### Create or update a Deal

Update a Deal in Pipedrive or create it if it doesn't exist yet.

Create or update a Deal is a **Cloud** action. The default Trigger is `type = "track" and event = "Deal Upserted"`

| Field                    | Description                                                                                                                                                                                                                                                         | Required | Type     |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- |
| Deal match field         | If present, used instead of field in settings to find existing deal in Pipedrive.                                                                                                                                                                                   | No       | STRING   |
| Deal match value         | Value to find existing deal by                                                                                                                                                                                                                                      | No       | STRING   |
| Person match field       | If present, used instead of field in settings to find existing person in Pipedrive.                                                                                                                                                                                 | No       | STRING   |
| Person match value       | Value to find existing person by. Required unless organization\_match\_value present                                                                                                                                                                                | No       | STRING   |
| Organization match field | If present, used instead of field in settings to find existing organization in Pipedrive.                                                                                                                                                                           | No       | STRING   |
| Organization match value | Value to find existing organization by. Required unless person\_match\_value present                                                                                                                                                                                | No       | STRING   |
| Title                    | Deal title  (required for new Leads)                                                                                                                                                                                                                                | Yes      | STRING   |
| Value                    | Value of the deal. If omitted, value will be set to 0.                                                                                                                                                                                                              | No       | STRING   |
| Currency                 | Currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user.                                                                                                                         | No       | STRING   |
| Stage ID                 | The ID of a stage this Deal will be placed in a pipeline (note that you can't supply the ID of the pipeline as this will be assigned automatically based on stage\_id). If omitted, the deal will be placed in the first stage of the default pipeline.             | No       | NUMBER   |
| Status                   | Deal status - open, won, lost or deleted. If omitted, status will be set to open.                                                                                                                                                                                   | No       | STRING   |
| Expected Close Date      | The expected close date of the Deal. In ISO 8601 format: YYYY-MM-DD.                                                                                                                                                                                                | No       | STRING   |
| Success Probability      | Deal success probability percentage. Used/shown only when deal\_probability for the pipeline of the deal is enabled.                                                                                                                                                | No       | NUMBER   |
| Lost Reason              | Optional message about why the deal was lost (to be used when status=lost)                                                                                                                                                                                          | No       | STRING   |
| Visible To               | Visibility of the deal. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user. 'Owner's visibility group and sub-groups' and 'Entire company' options only available with Professional or Enterprise plans | No       | STRING   |
| Created At               | If the deal is created, use this timestamp as the creation timestamp. Format: YYY-MM-DD HH:MM:SS                                                                                                                                                                    | No       | DATETIME |
| Custom fields            | New values for custom fields.                                                                                                                                                                                                                                       | No       | OBJECT   |
