Using field user_id to create activities is Ignored and assigned to other user

I am creating activities with Pipedrive API. To assign the activity to a pipedrive user, we use the field described in the API documentation user_id.
But the thing is that the activity is not assigned to that user, instead it is assigned to anothed user id. We see this in the response of Pipedrive for creating activities. The field that we see and is not documented anywhere is created_by_user_id.
Could someone please explain more about this behavior?
Thanks in advance.

Hi Victor,

Could you share an example of the exact code you’re using so I can test it?

Hello David, i will share an example

Please see an example of the data we sent to create activity in Pipedrive using your API:


'subject' =>"Juan Perez called +34-941-25-11-11"
'done' => true
'type' =>"call"
'due_date' => "2019-09-05"
'due_time' => "07:49"
'duration' =>"00:01"
'user_id' => "9617XXX"
'deal_id' => "2006"
'note' => "From: Juan Perez </br>To: +34-941-25-11-11 (Contact Hotel Good Sleep) </br>Duration: 00:49 seconds </br>

Response from Pipedrive

(Activity) => 'id' => 578XX , 'company_id' => 4311XXX, 'user_id' => 9617XXX , 'done' => true,

'type' => 'call', 'reference_type' => NULL, 'reference_id' => NULL, 'due_date' => '2019-09-05', 'due_time' => '07:49', 'duration' => '00:01', 'busy_flag' => true,

'add_time' => '2019-09-05 07:49:57', 'marked_as_done_time' => '2019-09-05 07:49:57', 'last_notification_time' => NULL, 'last_notification_user_id' => NULL, 'notification_language_id' => NULL,

'subject' => 'Juan Perez called +34-941-25-11-11', 'public_description' => NULL, 'location' => NULL, 'org_id' => 267XX, 'person_id' => 92X, 'deal_id' => 2006, 'active_flag' => true,

'update_time' => '2019-09-05 07:49:57', 'update_user_id' => NULL, 'gcal_event_id' => NULL, 'google_calendar_id' => NULL, 'google_calendar_etag' => NULL, 'source_timezone' => NULL,

'rec_rule' => NULL, 'rec_rule_extension' => NULL, 'rec_master_activity_id' => NULL,

'note' => 'From: Juan Perez called<br>To: +34-941-25-11-11 (Contact Hotel Good Sleep)<br>Duration: 00:49 seconds<br>Recording: <a href=[""]( target="_blank"></a>',

**'created_by_user_id' => 9699YYY**

When the customer try to retrieve a report from Pipedrive, all the activities are assigned or related to ‘created_by_user_id’ => 9699YYY and not to the ‘user_id’ => 9617XXX as it should be expected.

Hi Victor,

So the created_by_user_id is just that, whomever created the activity (API token) will marked as the creator of the Activity, but not necessarily the owner of the activity.

Your POST looks correct for it be assigned to 9617XXX. In the Body Response there should also be an assigned_to_user_id which states who it is assigned to.

What does it show for you?
Also, does Activity creator have permission to assign to this User and are they any Automations in place that could possibly be affecting this?