Skip to main content

Pipedrive

Pipedrive is a sales CRM. Its webhooks call an address when a deal changes. Pointed at the Flows address, such a webhook starts your flows when a deal moves to another stage — and the next message goes out, with a reminder if nothing happens.

There is a catch: Pipedrive's webhooks carry the id of the contact person, not the phone. To reach the customer, also send the event from a Pipedrive automation, where you write the body yourself and add the phone — see With the phone: a webhook in Automations.

Written from Pipedrive documentation

This page is written from the public documentation of Pipedrive and has not been checked on a live account yet.

What you need​

  • Webhooks are on every Pipedrive plan, up to 40 webhooks per user. A webhook comes only for the objects its user can see, so create it as an administrator.
  • The webhooks carry no phone and no email — only the id of the contact person and of the organisation. Such an event reaches only a contact AlphaFlow already knows by this id; otherwise it is refused with no_contact.
  • The phone comes with the webhook action of Automations: plan Growth or higher, and only a global administrator can create it.

Step 1. Create a connection​

  1. Open Flows → Connections, press Connect a system and choose Pipedrive.
  2. Press Copy address. It looks like https://events.alphasms.net/hooks/<TOKEN> — keep it secret.

Step 2. Create a webhook in Pipedrive​

  1. Open Settings → Tools and apps → Webhooks (app.pipedrive.com/settings/webhooks) and press Create new webhook.
  2. In Events in Pipedrive: Event action — change, Event objects — deal.
  3. User permission level — an administrator: the webhook comes only for the objects this user sees.
  4. In Endpoint outside Pipedrive: Webhook name — AlphaFlow, Endpoint URL — the address from the cabinet.
  5. Leave HTTP Auth username and HTTP Auth password empty: the secret is in the address.
  6. Press Save.
  • One webhook is enough. change · deal comes on any edit of a deal; AlphaFlow takes only the edits that change the stage and skips the others without an event — winning or losing a deal in the same stage too.
  • Do not add create · deal or create · lead webhooks: they carry no previous stage and are skipped. The first stage of a new deal therefore gives no event.
  • Do not choose the action delete or *: a delete event comes with no data and is skipped.
  • Webhooks for other objects — persons, organisations, activities, notes, products and others — are accepted and ignored. Do not create them.

Step 3. Send a test​

Move a test deal to another stage. Pipedrive shows the status of the last delivery in the list of webhooks (Settings → Tools and apps → Webhooks), and the event appears in Flows → Connections → Event journal within seconds. The connection shows Recognised: Pipedrive.

Events​

Webhook in PipedriveAlphaFlow eventProperties
change · deal, the stage changeddeal_stage_changeddeal_id, title, stage_id, previous_stage_id, pipeline_id, deal_status, value, currency

Every event also carries person_id, org_id, action, pipedrive_event_id and host.

  • stage_id is the number of the stage: Pipedrive does not send its name. Use the number in the conditions of a flow — you see it in the event in the journal.
  • deal_status is open, won or lost. A deal won or lost without a change of stage gives no event.
  • The table of stages in the connection is empty, so every stage gives deal_stage_changed. You can edit it in the connection.

The contact is found only by the id of the contact person (data.person_id). The names of the events are the ones the ready-made templates expect — see Recommended events.

With the phone: a webhook in Automations​

Pipedrive automations have a webhook action whose body you write yourself, and there you can put the phone of the contact person of the deal. Plan Growth or higher; only a global administrator creates it.

  1. In Tools and apps → Webhooks press + Webhooks and choose Automated webhook. Paste the address from the cabinet and add ? at the end: Pipedrive wants the address of an automated webhook to end in /, &, ? or =, and an empty ? does not change the address.
  2. In an automation add the webhook action: Method — POST, the body — Raw.
  3. Write the body below and put the fields of Pipedrive in place of the values in angle brackets with the button that picks a field.
{
"event": "deal_stage_changed",
"message_id": "pipedrive:deal_stage_changed:<deal ID>:<stage ID>",
"contact": {
"phone": "<phone of the contact person>",
"external_id": "<ID of the contact person>"
},
"properties": {
"deal_id": "<deal ID>",
"stage": "<stage>"
},
"context": { "source": "pipedrive" }
}
  • How the fields look inside the body is not described in the Pipedrive documentation. By a third-party description, the phone field is called Deal contact person phone. Check the body on a test deal.
  • message_id takes only printable ASCII characters without spaces, so it holds the ID of the stage, not its name; otherwise the event is refused with invalid_message_id. The name goes into stage.
  • Such a body is already in the AlphaFlow format: AlphaFlow takes it as it is, without the mapping of the webhooks above, and recognises Pipedrive by context.source.
  • With external_id equal to the id of the contact person, the contact in AlphaFlow gets both the phone and the Pipedrive id — and the events of the webhooks above reach this contact too.
  • Pipedrive mentions retries of this action ("Maximum retry limit reached"), but gives no numbers.

Good to know​

  • Pipedrive takes any 2XX as success. Otherwise, or after 10 seconds without an answer, it tries three more times — after 3, 30 and 150 seconds. After 10 failed first attempts it pauses the webhook for 30 minutes, and the events of that time are lost; a webhook with no successful delivery for 3 days is deleted.
  • A deal that returns to a stage it was already in gives a new event. A repeated delivery of the same change is not recorded twice.
  • Pipedrive webhooks have no signature, only an optional HTTP Basic auth. It is not needed: the secret is in the address.
  • The address always answers 200. Above the daily event limit the event is refused in AlphaFlow with quota_exceeded and shown in the journal; the webhook in Pipedrive stays on.

Pipedrive documentation​