# Cant assign task to user.

**URL:** <https://community.hubspot.com/t/cant-assign-task-to-user/84666>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [July 4, 2023, 1:53pm UTC](https://community.hubspot.com/t/cant-assign-task-to-user/84666 "2023-07-04T13:53:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JSpada](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jspada/32/199146_2.png) [@JSpada](https://community.hubspot.com/u/JSpada)\
**Post date:** [July 4, 2023, 1:53pm UTC](https://community.hubspot.com/t/cant-assign-task-to-user/84666/1 "2023-07-04T13:53:43Z")

</div>

Hello, im having an issue when Im tryin to assigned a task in Hubspot with a user:  
Im doing the following request:

async function createHubspotTask(createdHubspot, taskTitle, taskBody, userId) {

const url = “[https://api.hubapi.com/crm/v3/objects/tasks](https://api.hubapi.com/crm/v3/objects/tasks)”;

const now = new Date();

const timestamp = now.toISOString();

const data = {

```
properties: {

  hs\_timestamp: timestamp,

  hs\_task\_subject: taskTitle,

  hs\_task\_body: taskBody,

  hs\_task\_type: "TODO",

  hs\_task\_status: "NOT\_STARTED",

  hubspot\_owner\_id: userId,

},

```

};

const config = {

```
headers: {

  Authorization: \`Bearer ${createdHubspot.accessToken}\`,

  "Content-Type": "application/json",

},

```

};

try {

```
const res = await axios.post(url, data, config);

return res.data;

```

} catch (error) {

```
console.error("Error creando la task de hubspot: ", error);

```

}

}  
The errror im having is:  
Property values were not valid: [{“isValid”:false,“message”:“50481782 was not a valid owner ID”,“error”:“INVALID\_OWNER\_ID”,“name”:“hubspot\_owner\_id”,“localizedErrorMessage”:"50481782 was not a valid owner ID.

But I think the user ID its Ok, because is the same that it appears on my profile user url:  
[https://app.hubspot.com/settings/24325849/users/user/50481782,](https://app.hubspot.com/settings/24325849/users/user/50481782,)as you can see my id is 50481782 so IDK why im receiving that error from the API.  
Someone knows if Im missing something?  
Thank you

---

<div class="post-metadata">

**Author:** ![JSpada](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jspada/32/199146_2.png) [@JSpada](https://community.hubspot.com/u/JSpada)\
**Post date:** [July 4, 2023, 2:31pm UTC](https://community.hubspot.com/t/cant-assign-task-to-user/84666/2 "2023-07-04T14:31:08Z")

</div>

My bad, I was using the suerId instead of ownerId.
