Hi there, I have these users in hubspot, where the highlighted one has assigned a task.
Check below screenshot of Assigned Task:
Following is property I found using task properties end point:
When I hit the endpoint to fetch tasks, it returns following Id in AssignedTo User.
So which other property is used for Assigned To field of Task?
Because in Users API, I can see same Id as I exported in excel, but in Tasks API it is different.
Can anybody please suggest on this? Which property should I consider for Assigned To field in Task API?
Hey @yprajapati1,
The property “hubspot_owner_id” on the task object is what is used to control who the task is assigned to. It returns the owner ID if you were to retrieve tasks from the CRM. These owner IDs are associated to specific users in the portal. You can use GET /crm/v3/owners/ to pull a list of owners. For instance:
GET https://api.hubapi.com/crm/v3/owners/
RESPONSE:
{
"results": [
{
"id": "1204524575",
"email": "***@gmail.com",
"firstName": "Jack",
"lastName": "Coldrick",
"userId": 4592290,
"userIdIncludingInactive": 4592290,
"createdAt": "2024-07-18T20:08:13.608Z",
"updatedAt": "2024-07-18T20:08:13.608Z",
"archived": false
}
]
}
Notice in the above I have an “userId” of “4592290” but also an “id” of “1204524575”. That is my owner ID and ultimately what is used to associate tasks to users. For example if I make a request to GET /crm/v3/objects/tasks as follows you will see the “hubspot_owner_id” being returned correctly:
GET https://api.hubapi.com/crm/v3/objects/tasks?properties=hubspot_owner_id
RESPONSE
{
"results": [
{
"id": "31319162089",
"properties": {
"hs_createdate": "2024-08-08T14:26:07.802Z",
"hs_lastmodifieddate": "2024-08-20T11:30:22.427Z",
"hs_object_id": "31319162089",
"hubspot_owner_id": "1204524575"
},
"createdAt": "2024-08-08T14:26:07.802Z",
"updatedAt": "2024-08-20T11:30:22.427Z",
"archived": false
}
]
}
This is the task showing on the contact record in HubSpot:
In short, you need to use the owner ID when creating tasks. Not the user ID. These can be obtained by calling the Owners API and passing it in your request to the Task API using the “hubSpot_owner_id” property.
I hope this helps,
Jack