# Set Contact Owner with Create or Update API

**URL:** <https://community.hubspot.com/t/set-contact-owner-with-create-or-update-api/51129>\
**Category:** CMS Development\
**Tags:** javascript\
**Created:** [February 8, 2022, 7:00pm UTC](https://community.hubspot.com/t/set-contact-owner-with-create-or-update-api/51129 "2022-02-08T19:00:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brownstephen101](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brownstephen101/32/52735_2.png) [@Brownstephen101](https://community.hubspot.com/u/Brownstephen101)\
**Post date:** [February 8, 2022, 7:00pm UTC](https://community.hubspot.com/t/set-contact-owner-with-create-or-update-api/51129/1 "2022-02-08T19:00:29Z")

</div>

Hello, does anyone know if it’s possible to set the owner of a contact using the Create or Update contact api? I’m not sure if it’s a bug, I am creating a contact and company and then associating them, and as part of the payload for each, it checks if there is an owner query parameter and sets the owner if there is. It is working in all regards, but for some reason the owner is not being set on the contact record (it is working for the company).  
I logged the data being sent for the contact, it is:

`{"properties":[{"property":"firstname","value":"Stephen"},{"property":"lastname","value":"Brown"},{"property":"email","value":"stephen+test2@impulsecreative.com"},{"property":"company","value":"testfdas"},{"property":"hubspot_owner_id","value":"87349627"}]}`

All properties other than hubspot\_owner\_id are being set without issue. I should note that there are no errors that are being caught.Any help would be appreciated

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [February 8, 2022, 7:29pm UTC](https://community.hubspot.com/t/set-contact-owner-with-create-or-update-api/51129/2 "2022-02-08T19:29:38Z")

</div>

@Brownstephen101

I have not tested this on the v1 endpoint that it appears that you are using. I will in a minute 😀, but

I did just verify that it works when patching via the [v3 endpoint](https://developers.hubspot.com/docs/api/crm/contacts)

my call (I removed the other properties, but obviously, you can add them back):

_**[https://api.hubapi.com/crm/v3/objects/contacts/58951?hapikey={{hapikey}](https://api.hubapi.com/crm/v3/objects/contacts/58951?hapikey=%7B%7Bhapikey%7D)}**_

```lia-code-sample
{
 "properties":{
 "hubspot_owner_id": "49773289"
 }
}

```

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [February 8, 2022, 7:35pm UTC](https://community.hubspot.com/t/set-contact-owner-with-create-or-update-api/51129/3 "2022-02-08T19:35:01Z")

</div>

Follow up -- tested with the v1 endpoint and had no issue there either 🤔

Can you confirm which endpoint you are using and also that the owner id is correct?

---

<div class="post-metadata">

**Author:** ![Brownstephen101](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brownstephen101/32/52735_2.png) [@Brownstephen101](https://community.hubspot.com/u/Brownstephen101)\
**Post date:** [February 8, 2022, 10:34pm UTC](https://community.hubspot.com/t/set-contact-owner-with-create-or-update-api/51129/4 "2022-02-08T22:34:47Z")

</div>

I ended up figuring it out, it was because my email was pulling as undefined in the request\_url  
`[https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/${email}?hapikey=${API\_KEY](https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/$%7Bemail%7D?hapikey=$%7BAPI_KEY)}`  
I thought that would throw an error. Surprisingly, it doesn’t. It let the function run and even created a new contact with the payload data, but it wouldn’t add any properties other than first name, last name, company, and email.
