# Creating Note via API - Created By or Owner fields

**URL:** <https://community.hubspot.com/t/creating-note-via-api-created-by-or-owner-fields/43014>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [August 27, 2021, 3:41pm UTC](https://community.hubspot.com/t/creating-note-via-api-created-by-or-owner-fields/43014 "2021-08-27T15:41:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![diogodpc](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/diogodpc/32/89259_2.png) [@diogodpc](https://community.hubspot.com/u/diogodpc)\
**Post date:** [August 27, 2021, 3:41pm UTC](https://community.hubspot.com/t/creating-note-via-api-created-by-or-owner-fields/43014/1 "2021-08-27T15:41:21Z")

</div>

Hello!

When a user creates a note via HubSpot app, the creator is identified:

Notice the “by Diogo Cabral”, the user who created the note.

 ![Screenshot 2021-08-27 at 16.38.38.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/1/81b7de75f7cc0060d119483adffb38fe9108305b.png)  
Created By

However, when you create via API, I can’t get this to show up:

 ![Screenshot 2021-08-27 at 16.39.43.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/1/6/16b31bc9d3051f9934028937c1a8e35460bedfc5.png)  
No Created By

Here’s the JSON I’m using:

{

“engagement”: {

“active”: true,

“ownerId”: \<redacted\>,

“type”: “NOTE”,

“timestamp”: 1404122644778

},

“associations”: {

“contactIds”: [4009],

“companyIds”: [],

“dealIds”: [],

“ownerIds”: [\<redacted\>],

“ticketIds”: []

},

“attachments”: [],

“metadata”: {

“body”: “bla bla bla”

}

}

(sorry, I can’t format this, for some reason)

I’ve tried everything I can remember, like adding createdBy, ownerId in metadata and in associations, source/sourceId, but can’t get it to appear.

In the context of a data migration, it’s quite important to be know who created a note in some other system.

Can anyone offer assistance?

Thanks!

---

<div class="post-metadata">

**Author:** ![Mansoor](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mansoor/32/82448_2.png) [@Mansoor](https://community.hubspot.com/u/Mansoor)\
**Post date:** [August 28, 2021, 12:46am UTC](https://community.hubspot.com/t/creating-note-via-api-created-by-or-owner-fields/43014/2 "2021-08-28T00:46:26Z")

</div>

I would check to make sure you are supplying the right ownerId. These are hubspot internal users.  
here is what I am using and it is allowing me to see the the “By OWNER”:

const noteObj = await hubspot.engagements.create({

engagement: {

active: true,

ownerId: 47517632,

type: ‘NOTE’,

timestamp: Date.now()

},

associations: {

contactIds: [],

companyIds: [],

dealIds: [],

ownerIds: [],

ticketIds: []

},

attachments: [],

metadata: {

body: `OWNER ID TEST`

}

});

---

<div class="post-metadata">

**Author:** ![diogodpc](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/diogodpc/32/89259_2.png) [@diogodpc](https://community.hubspot.com/u/diogodpc)\
**Post date:** [August 28, 2021, 4:54pm UTC](https://community.hubspot.com/t/creating-note-via-api-created-by-or-owner-fields/43014/3 "2021-08-28T16:54:56Z")

</div>

Hey Mansoor,

Thanks for your response - are you using API token or Oauth to authenticate? I’m thinking maybe that’s the issue.

I’m using an API key, and have triple checked the User ID by GETting existing engagements - it’s the correct value, unfortunately…

Thanks,

dc

---

<div class="post-metadata">

**Author:** ![Mansoor](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mansoor/32/82448_2.png) [@Mansoor](https://community.hubspot.com/u/Mansoor)\
**Post date:** [August 29, 2021, 3:03am UTC](https://community.hubspot.com/t/creating-note-via-api-created-by-or-owner-fields/43014/4 "2021-08-29T03:03:15Z")

</div>

I am using an API token.  
I was able to find the ownerID going through the manage properties on a deal and using the owner ID from the list of populated values.

---

<div class="post-metadata">

**Author:** ![diogodpc](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/diogodpc/32/89259_2.png) [@diogodpc](https://community.hubspot.com/u/diogodpc)\
**Post date:** [August 30, 2021, 8:51am UTC](https://community.hubspot.com/t/creating-note-via-api-created-by-or-owner-fields/43014/5 "2021-08-30T08:51:48Z")

</div>

Hi Mansoor,

You are absolutely right!

For the record, here’s where I was wrong: I thought the user ID was the last part of the URL when you go into a user’s page:

[https://app.hubspot.com/settings/\<instanceId\>/users/editUser/IdGoesHere](https://community.hubspot.com/)

And that’s the value I was using.

But it turns out that is not the ID. I got the ID like you said, by going into a deal and inspecting the OwnerID element. Sent in the correct ID, and worked like a charm.

Thanks very much!

dc
