# Problem with creating a note using https://api.hubapi.com/crm/v3/objects/notes

**URL:** <https://community.hubspot.com/t/problem-with-creating-a-note-using-https-api-hubapi-com-crm-v3-objects-notes/127386>\
**Category:** APIs & Integrations\
**Tags:** companies\
**Created:** [March 5, 2025, 3:40pm UTC](https://community.hubspot.com/t/problem-with-creating-a-note-using-https-api-hubapi-com-crm-v3-objects-notes/127386 "2025-03-05T15:40:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![yorambaron](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/yorambaron/32/18373_2.png) [@yorambaron](https://community.hubspot.com/u/yorambaron)\
**Post date:** [March 5, 2025, 3:40pm UTC](https://community.hubspot.com/t/problem-with-creating-a-note-using-https-api-hubapi-com-crm-v3-objects-notes/127386/1 "2025-03-05T15:40:14Z")

</div>

I want to create a note that attaches a file (in the file manager) to a company.

I used [https://api.hubapi.com/crm/v3/objects/notes](https://api.hubapi.com/crm/v3/objects/notes) with curl following JSON object.

{  
“associations”: [  
{  
“types”: [  
{  
“associationCategory”: “HUBSPOT\_DEFINED”,  
“associationTypeId”: 2  
}  
],  
“to”: {  
“id”: “2597827578”,  
“type”: “company”  
}  
}  
],  
“attachments”: [  
{  
“id”: “186910861670”  
}  
],  
“properties”: {  
“hs\_note\_body”: “Comment”  
}  
}

I recieved the error:

{  
“context”: {  
“properties”: [  
“hs\_timestamp”  
]  
},  
“correlationId”: “a3553c8c-bdac-4148-885b-20abdd9d7708”,  
“message”: “Error creating NOTE. Some required properties were not set.”,  
“category”: “VALIDATION\_ERROR”,  
“status”: “error”  
}

What did I do wrong?

---

<div class="post-metadata">

**Author:** ![MichaelMa](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MichaelMa](https://community.hubspot.com/u/MichaelMa)\
**Post date:** [March 5, 2025, 5:42pm UTC](https://community.hubspot.com/t/problem-with-creating-a-note-using-https-api-hubapi-com-crm-v3-objects-notes/127386/2 "2025-03-05T17:42:15Z")

</div>

It’s noted in the context response. You’re missing the required property of “hs\_timestamp” (unix timestamp) in your payload.

---

<div class="post-metadata">

**Author:** ![yorambaron](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/yorambaron/32/18373_2.png) [@yorambaron](https://community.hubspot.com/u/yorambaron)\
**Post date:** [March 5, 2025, 5:58pm UTC](https://community.hubspot.com/t/problem-with-creating-a-note-using-https-api-hubapi-com-crm-v3-objects-notes/127386/3 "2025-03-05T17:58:02Z")

</div>

I added “hs\_timestamp” the JSON see the error message:

{  
“correlationId”: “0ebef994-344a-4b10-b7ad-2944a6de62b9”,  
“message”: “invalid from object type 0-46 for associations to be created. expected: 0-2”,  
“category”: “VALIDATION\_ERROR”,  
“status”: “error”  
}

JSON request:

{  
“associations”: [  
{  
“types”: [  
{  
“associationCategory”: “HUBSPOT\_DEFINED”,  
“associationTypeId”: 2  
}  
],  
“to”: {  
“id”: “2597827578”,  
“type”: “company”  
}  
}  
],  
“attachments”: [  
{  
“id”: “186918798705”  
}  
],  
“properties”: {  
“hs\_timestamp”: 1735047120,  
“hs\_note\_body”: “message”  
}  
}

---

<div class="post-metadata">

**Author:** ![MichaelMa](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MichaelMa](https://community.hubspot.com/u/MichaelMa)\
**Post date:** [March 5, 2025, 6:28pm UTC](https://community.hubspot.com/t/problem-with-creating-a-note-using-https-api-hubapi-com-crm-v3-objects-notes/127386/4 "2025-03-05T18:28:44Z")

</div>

It looks your like JSON is a bit off.

```lia-code-sample
{
 "associations": [
 {
 "to": {
 "id": "2597827578"
 },
 "types": [
 {
 "associationCategory": "HUBSPOT_DEFINED",
 "associationTypeId": 190
 }
 ]
 }
 ],
 "attachments": [
 {
 "id": "186918798705"
 }
 ],
 "properties": {
 "hs_note_body": "Comment",
 "hs_timestamp": 1735047120
 }
}

```

This page has a good sample JSON:

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

For the list of associationTypeId (note to X):

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

---

<div class="post-metadata">

**Author:** ![yorambaron](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/yorambaron/32/18373_2.png) [@yorambaron](https://community.hubspot.com/u/yorambaron)\
**Post date:** [March 6, 2025, 3:55pm UTC](https://community.hubspot.com/t/problem-with-creating-a-note-using-https-api-hubapi-com-crm-v3-objects-notes/127386/5 "2025-03-06T15:55:00Z")

</div>

Thanks MichaelMa,

I changed the JSON and received the following error:

{“correlationId”:“3fceddb8-7c41-4fb7-adfd-7253f5eca0e9”,“message”:“invalid from object type 0-46 for associations to be created. expected: 0-2”,“category”:“VALIDATION\_ERROR”,“status”:“error”}

Following is the JSON structure based on the link that you provided.

Any idea what the problem is? I find the error message challenging..

{  
“associations”: [  
{  
“types”: [  
{  
“associationCategory”: “HUBSPOT\_DEFINED”,  
“associationTypeId”: 189  
}  
],  
“to”: {  
“id”: 2597827578  
}  
}  
],  
“properties”: {  
“hs\_attachment\_ids”: “186964207421”,  
“hs\_timestamp”: 1741259013,  
“hs\_note\_body”: “comment”  
}  
}

---

<div class="post-metadata">

**Author:** ![MichaelMa](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MichaelMa](https://community.hubspot.com/u/MichaelMa)\
**Post date:** [March 6, 2025, 5:01pm UTC](https://community.hubspot.com/t/problem-with-creating-a-note-using-https-api-hubapi-com-crm-v3-objects-notes/127386/6 "2025-03-06T17:01:16Z")

</div>

associationTypeId 189 is COMPANY to NOTE which is incorrect as you’re starting from the NOTE object. NOTE to COMPANY is 190.

---

<div class="post-metadata">

**Author:** ![yorambaron](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/yorambaron/32/18373_2.png) [@yorambaron](https://community.hubspot.com/u/yorambaron)\
**Post date:** [March 6, 2025, 7:49pm UTC](https://community.hubspot.com/t/problem-with-creating-a-note-using-https-api-hubapi-com-crm-v3-objects-notes/127386/7 "2025-03-06T19:49:50Z")

</div>

In the [link](https://developers.hubspot.com/docs/guides/api/crm/engagements/notes?_gl=1*1r1fge8*_ga*MzQ2MzkxNDk0LjE3NDEyNzY1OTg.*_ga_LXTM6CQ0XK*MTc0MTI4NzY1My40LjEuMTc0MTI5MDQ1Ni42MC4wLjA.#associations)

the “hs\_timestamp”: “2021-11-12T15:48:22Z” is incorect, it should be a unix timestamp.

---

<div class="post-metadata">

**Author:** ![GiantFocal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/giantfocal/32/41969_2.png) [@GiantFocal](https://community.hubspot.com/u/GiantFocal)\
**Post date:** [March 6, 2025, 1:47am UTC](https://community.hubspot.com/t/problem-with-creating-a-note-using-https-api-hubapi-com-crm-v3-objects-notes/127386/8 "2025-03-06T01:47:32Z")

</div>

Hi @yorambaron,

The error occurs because the required “hs\_timestamp” parameter is missing from your JSON request.

To fix this issue, add the “hs\_timestamp” field to the properties object in your JSON request. Your updated JSON should appear as follows:

```lia-code-sample
{
"associations": [
{
"types": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 2
}
],
"to": {
"id": "2597827578",
"type": "company"
}
}
],
"attachments": [
{
"id": "186910861670"
}
],
"properties": {
"hs_note_body": "Comment",
"hs_timestamp": "1709688326000" // Add current timestamp in milliseconds
}
}

```
