# Getting INVALID\_OWNER\_ID error when trying to create timeline event

**URL:** <https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885>\
**Category:** CRM\
**Tags:** crm, contacts, integrations\
**Created:** [October 25, 2022, 8:51pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885 "2022-10-25T20:51:00Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![JF\_dev](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jf_dev/32/196708_2.png) [@JF\_dev](https://community.hubspot.com/u/JF_dev)\
**Post date:** [October 25, 2022, 8:51pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/1 "2022-10-25T20:51:00Z")

</div>

Hello,

I’m trying to create a timeline event on a contact. The event has a custom token, `ownerId` with a mapping to a custom property on Contacts named `owner`.

The custom property is a HubSpot user field type.

So the idea is then when I create an action in the contact activity timeline and pass an `ownerId`, the contact will automatically get assigned to the owner.

But the issue is that when I make the request to:

POST /crm/v3/timeline/events

with body (abbreviated for concision) :  
{

…

“tokens”: { “ownerId”: 1234 }

}

I get the following error:

validationResults":[{“isValid”:false,“message”:“1234 was not a valid owner ID”,“error”:“INVALID\_OWNER\_ID”,“name”:“owner”}]

**Note:** The ID isn’t actually 1234, it’s an owner ID that I got from querying the /crm/v3/owners endpoint, so I know it’s a valid owner ID.

Please let me know if you see anything that I’m doing wrong, or if there’s a better way to assign owners to contacts via timeline events

---

<div class="post-metadata">

**Author:** ![jolle](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jolle/32/44040_2.png) [@jolle](https://community.hubspot.com/u/jolle)\
**Post date:** [October 25, 2022, 9:16pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/2 "2022-10-25T21:16:41Z")

</div>

Hey [@JF\_dev](https://community.hubspot.com/t5/user/viewprofilepage/user-id/466498), thanks for sharing! I don’t have a ton of HubSpot development experience, but I’m wondering if this has anything to do with the fact that you’re mapping to a custom contact property instead of the default “Contact owner” property. Do you get the same result if you use “Contact owner” instead?

---

<div class="post-metadata">

**Author:** ![JF\_dev](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jf_dev/32/196708_2.png) [@JF\_dev](https://community.hubspot.com/u/JF_dev)\
**Post date:** [October 25, 2022, 9:36pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/3 "2022-10-25T21:36:41Z")

</div>

Hi @jolle,

There’s no “Contact owner” property mapping in the UI dropdown menu, but I did some digging and it looks like the field is called `hubspot_owner_id` .

If I set my custom token to map to that field (it lets me “create” a field with that name), I see the same behavior.

I’ve tried setting the data type to either String or Integer, and in both cases I still get the INVALID\_OWNER\_ID error back 😕

---

<div class="post-metadata">

**Author:** ![jolle](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jolle/32/44040_2.png) [@jolle](https://community.hubspot.com/u/jolle)\
**Post date:** [October 25, 2022, 9:43pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/4 "2022-10-25T21:43:30Z")

</div>

Thanks for the quick response! I’m going to tap into some awesome HubSpot Community members.

@danmoyle @Jnix284 @crispyGTM any idea what could be the issue here?

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [October 25, 2022, 11:11pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/5 "2022-10-25T23:11:07Z")

</div>

Hi @jolle and [@JF\_dev](https://community.hubspot.com/t5/user/viewprofilepage/user-id/466498) , sorry I can’t be of more help, I don’t do any development on the workflow side.

Maybe @Teun might be able to help or point you in the right direction?

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [October 26, 2022, 6:23am UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/6 "2022-10-26T06:23:15Z")

</div>

Hi [@JF\_dev](https://community.hubspot.com/t5/user/viewprofilepage/user-id/466498) ,

I could be mistaken, but the ownerId is not used to assign the contact, but assign the engagement, like a task. So you can not set the owner of a contact using the timeline property.

Check these [docs](https://legacydocs.hubspot.com/docs/methods/engagements/engagements-overview), I hope this explains it a bit better.

---

<div class="post-metadata">

**Author:** ![crispyGTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/crispygtm/32/40025_2.png) [@crispyGTM](https://community.hubspot.com/u/crispyGTM)\
**Post date:** [October 26, 2022, 1:58pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/7 "2022-10-26T13:58:35Z")

</div>

@jolle @danmoyle [@JF\_dev](https://community.hubspot.com/t5/user/viewprofilepage/user-id/466498) I believe this is because the property isn’t considered a string because contact owner is a user-property (Internal ID), meaning that it updates with the internal users in the platform.  
Are you mapping the token based upon the internal IDs of the HubSpot users?  
**Go to Settings-\>Properties-\>Contact Properties and search and click on the Contact Owner Property**. On that screen, it will list your contact owners (users) and their internal value (user ID.)

---

<div class="post-metadata">

**Author:** ![JF\_dev](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jf_dev/32/196708_2.png) [@JF\_dev](https://community.hubspot.com/u/JF_dev)\
**Post date:** [October 26, 2022, 8:41pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/8 "2022-10-26T20:41:24Z")

</div>

@crispyGTMThank you for pointing me to the Contact Owner Property!! I did some more digging and can now clearly state what the problem is.

The property being a string is not the actual issue, it’s that the IDs listed for the contact owners don’t match the ones returned by the API.

Once I used the “internal value” listed in the UI, it worked!

I was able to use ID `123456` as the value of my custom token `ownerId`.

This custom token has a Contact property mapping of `hubspot_owner_id`, so when I create a timeline event for a contact that doesn’t have an owner, it automatically gets assigned to the owner matching that ID.

 ![Screen Shot 2022-10-26 at 2.57.09 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/4/54c919d2d08157f6e68d47a6330efb7ced29f7f4.png)

So the main issue here is, what \_is\_ id `123456`?? As far as I can tell it’s not a User id nor an Owner id.

When I query the CRM Owners API, I find `John Doe` but its `id` and `userId` are different than the “Internal Value” ID above.

Is there any way for me to find this ID via any APIs?

cc @Teun @danmoyle

---

<div class="post-metadata">

**Author:** ![crispyGTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/crispygtm/32/40025_2.png) [@crispyGTM](https://community.hubspot.com/u/crispyGTM)\
**Post date:** [October 26, 2022, 8:43pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/9 "2022-10-26T20:43:47Z")

</div>

[@JF\_dev](https://community.hubspot.com/t5/user/viewprofilepage/user-id/466498) This article may help: [https://legacydocs.hubspot.com/docs/methods/owners/get\_owners](https://legacydocs.hubspot.com/docs/methods/owners/get_owners)

---

<div class="post-metadata">

**Author:** ![JF\_dev](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jf_dev/32/196708_2.png) [@JF\_dev](https://community.hubspot.com/u/JF_dev)\
**Post date:** [October 26, 2022, 9:22pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/10 "2022-10-26T21:22:29Z")

</div>

@crispyGTM

I was previously querying the v3 endpoint: “/crm/v3/owners” and only getting back “id” and “userId”

The article you linked me is for the v2 endpoint: “/owners/v2/owners” which returns more stuff (portalId, remoteId, activeUserId) but unfortunately none of them match the “Internal Value” id from the UI, which is the only one that works 😞

---

<div class="post-metadata">

**Author:** ![crispyGTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/crispygtm/32/40025_2.png) [@crispyGTM](https://community.hubspot.com/u/crispyGTM)\
**Post date:** [October 26, 2022, 10:52pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/11 "2022-10-26T22:52:12Z")

</div>

[@JF\_dev](https://community.hubspot.com/t5/user/viewprofilepage/user-id/466498) How about this one:

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fapi-reference%2Fcrm-crm-owners-v3%2Fguide)**

---

<div class="post-metadata">

**Author:** ![JF\_dev](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jf_dev/32/196708_2.png) [@JF\_dev](https://community.hubspot.com/u/JF_dev)\
**Post date:** [October 27, 2022, 2:29pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/12 "2022-10-27T14:29:20Z")

</div>

@crispyGTMAha! Figured it out 🙂

I was querying the **/owners** endpoint, but using the developer API key, which returns a _different_ owner ID than if I query the same endpoint using OAuth.

So if I authenticate with OAuth instead, I find the owner with the correct ID which allows me to pass this ID in when creating a Contact timeline event, and have it auto-assign the owner to the contact. Hooray!!

---

<div class="post-metadata">

**Author:** ![danmoyle](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/danmoyle/32/91166_2.png) [@danmoyle](https://community.hubspot.com/u/danmoyle)\
**Post date:** [October 26, 2022, 12:10pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/13 "2022-10-26T12:10:00Z")

</div>

Thanks for thinking of me @jolle. My dev chops are light, but I’ll share this with my colleague @Kevin-C and our dev team. Kevin may have insight for you [@JF\_dev](https://community.hubspot.com/t5/user/viewprofilepage/user-id/466498) .

---

<div class="post-metadata">

**Author:** ![SDavisCT](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@SDavisCT](https://community.hubspot.com/u/SDavisCT)\
**Post date:** [April 3, 2024, 3:20pm UTC](https://community.hubspot.com/t/getting-invalid-owner-id-error-when-trying-to-create-timeline-event/67885/14 "2024-04-03T15:20:24Z")

</div>

I just wanted to say thanks, many months later - without this, I would not have connected that there were different ID numbers for contact owner vs deal owner.
