Capture User ID for user who made the change

Hi, For my business I’d like to track which users have better conversion, etc. However, this requires that we are able to determine from the webhook the user that triggered that “update a deal” or “update a person” event. But it seems that the user ID for the person who made that “click” or change, isn’t included in the webhook? I really hope I"m wrong!

Hi @hvy_weight!

There is a meta-object in webhook request body that contains user_id (a user who triggered an event) and company_id (a company where an event happened).

{
  //...
  "meta": {
     // ...
     "company_id": <ID of the company where the webhook was triggered in>,
     "user_id": <ID of the user who triggered the webhook>,
     //...
   },
   //...    
}

For example, If you have a configured webhook for a deal update event, and a user within Pipedrive company where the configuration was made triggers this event, the webhook request body will include that user’s id in the meta object.

Would it work for your case?

1 Like

@mykhailo That was my assumption too - that I could use the user_id field. However, my testing indicates that the “user_id” is actually the user that “owns” the deal, not the actual user that made the change.

Hi @hvy_weight

Here is how I tested it:

I have a Pipedrive company with two users (user 1 and user 2).

Screenshot 2020-07-21 at 10.32.39

User 1 added a deal (user 1 is an owner)

User 2 moves a deal to a different stage (updates a deal)

Screenshot 2020-07-21 at 10.18.57

As I had configured webhook by user 1 for deal update event

My endpoint was called, and meta object included user_id that equals to User 2 id (a second user triggered a deal update event)

Could you try this flow and see if it would work for you in the same way? Or what’s the deal update flow that does not work for you?

1 Like

@mykhailo thank you for making the effort to help me! Here is how I tested. On a given deal of which I am not the owner, I advanced the stage and then captured the webhook. But the “User” info captured by the webhook is the user ID of the owner of the deal, not my user ID.

@hvy_weight If I got it right, you’re referring to the same scenario with deal update event as I had in my testing (previous reply), move a deal to a different stage triggers a deal update event that captured by configured webhook (please correct me if I wrong).

If so, I’ve checked it once again, and it produces the expected output in meta object (as described in here https://pipedrive.readme.io/docs/guide-for-webhooks#section-webhooks-meta-block).

May I ask you how do you check if the user_id in the meta object is a user who owns a deal and not a user who made a change?

1 Like

@mykhailo Here is a screen capture of how I’m testing. Please check it out and let me know if I’m missing something! https://www.loom.com/share/cb77006b289d4b67885353a949e76c8b

1 Like

@hvy_weight thanks for the video! Now I see where the problem is.

I assume that your configuration in Integromat starts as Pipedrive CRM (not legacy version) -> New Deal events, which prompts you to create a webhook in Pipedrive.

I tried it myself and got exactly the same response as you got in a video, no meta object

But the raw Webhook (if you try to capture it programmatically) request body looks like this

Hence, this Integromat configuration does not capture “meta” key from the Webhook request body.

I checked what Integromat provides and it has the possibility to capture Webhook as it is, and it does include all keys, please check the video https://sharing.pipedrive.com/JpL15y

There is one limitation with this approach, it seems like there is no way to set username/password for custom Webhook, but with Pipedrive CRM you can

To summarize

  • You can get meta object which includes a user_id of a user who triggered an event if you use custom webhook in Integromat, but it does not allow you to set username/password

  • I assume you can ask Integromat support if they are going to use meta object too, so it would appear in your existing configuration

I hope it helped, and if there are some questions do not hesitate to ask.