Setting the user or owner on communications created via API in HubSpot

Hi HubSpot community!

I’ve successfully created a communication via the API (specifically, a WhatsApp message), and I’ve been able to associate the communication with the correct contact using the engagements endpoint.

However, I’m running into an issue where the communication is showing up in the UI as being logged by an “Unknown User” instead of the actual user who logged it. I do have access to the user’s owner_id and hubspot_user_id from my system, but I can’t figure out how to set this correctly in the API request to ensure that the user is properly displayed as the one who logged the communication.

Here’s what I’ve tried so far:

- Created the communication and associated it with the contact successfully.

- Retrieved the correct user/owner details (HubSpot Owner ID and User ID) via the Owners API.
- Also tried to associate the communication with the “Contact” of the user, but got errors with the association type and the object type being off.

Can you somehow set a from: {}?

What I’m not sure about is how to include this information in the API request so that it’s properly reflected in the UI as being logged by the correct user. Could anyone help clarify how to achieve this or point me to the correct fields or properties to include in the API request?

Screenshot 2024-09-19 at 23.46.02.png

Thanks in advance for your help!

I’ve fixed this! You need to set the hubspot_owner_id with the owner ID

properties: {
hs_communication_channel_type: "WHATS_APP",
hubspot_owner_id: hubspotOwnerId,
hs_communication_logged_from: "CRM",
hs_communication_body: hsCommunicationBody, 
hs_timestamp: new Date().toISOString(),
},

Hi @suitophobiac ,

This isn’t mentioned in the API docs, but you need to set the owner through a property instead of creating an association. You can use the `hubspot_owner_id` property for that.

Here is a post from the amazing @Jaycee_Lewis who did a test with an SMS, it should work the same for WhatsApp messages.