# Error while create contact note

**URL:** <https://community.hubspot.com/t/error-while-create-contact-note/75487>\
**Category:** APIs & Integrations\
**Tags:** php\
**Created:** [February 17, 2023, 8:23pm UTC](https://community.hubspot.com/t/error-while-create-contact-note/75487 "2023-02-17T20:23:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JAndrus8](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@JAndrus8](https://community.hubspot.com/u/JAndrus8)\
**Post date:** [February 17, 2023, 8:23pm UTC](https://community.hubspot.com/t/error-while-create-contact-note/75487/1 "2023-02-17T20:23:23Z")

</div>

I am trying to create a note for a contact using a API request but it gives following response

```auto
{
 "status": "error",
 "message": "invalid from object type 0-46 for associations to be created. expected: 0-1",
 "correlationId": "da755ba0-b9e5-40e7-b3ef-97c870f7018e",
 "category": "VALIDATION_ERROR"
} 

```

this is how my request look like

```auto
{
"properties": {
 "hs_timestamp": "2023-02-12T15:48:22Z",
 "hs_note_body": "test note body"
},
 "associations": [
 {
 "to": {
 "id": 123 // customer id
 },
 "types": [
 {
 "associationCategory": "HUBSPOT_DEFINED",
 "associationTypeId": 201
 } ]
 }
 ]
}

```

any idea about what’s going wrong here

---

<div class="post-metadata">

**Author:** ![sbrandes](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@sbrandes](https://community.hubspot.com/u/sbrandes)\
**Post date:** [March 9, 2023, 12:01pm UTC](https://community.hubspot.com/t/error-while-create-contact-note/75487/2 "2023-03-09T12:01:32Z")

</div>

I have **exactly** the same issue.

When making a request to [https://api.hubapi.com/crm/v4/associations/contact/note/labels](https://api.hubapi.com/crm/v4/associations/contact/note/labels), I get the following response.

```auto
{
 "results": [
 {
 "category": "HUBSPOT_DEFINED",
 "typeId": 201,
 "label": null
 }
 ]
}

```

So, I have used **201** as the association type ID like you. Still, I am getting this validation error.

Any chance we can get some help on this?

---

<div class="post-metadata">

**Author:** ![JAndrus8](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@JAndrus8](https://community.hubspot.com/u/JAndrus8)\
**Post date:** [March 13, 2023, 2:07pm UTC](https://community.hubspot.com/t/error-while-create-contact-note/75487/3 "2023-03-13T14:07:52Z")

</div>

Hey I was able to find the solution for this.

You need to use association typeId as 201 instead of 202

---

<div class="post-metadata">

**Author:** ![Skipio-CRey](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/skipio-crey/32/198510_2.png) [@Skipio-CRey](https://community.hubspot.com/u/Skipio-CRey)\
**Post date:** [May 4, 2023, 7:52pm UTC](https://community.hubspot.com/t/error-while-create-contact-note/75487/4 "2023-05-04T19:52:38Z")

</div>

using `“associationTypeId”: 201` didn’t work for me either, even though that’s the `typeId` returned from

_`GET [https://api.hubapi.com/crm/v4/associations/contact/note/labels\`](https://api.hubapi.com/crm/v4/associations/contact/note/labels%5C%60)_.

~~But when I set it to `“associationTypeId”: 202` it randomly worked… 🤷 no idea why as `202` is NOT correct; I just randomly tried that number 🤦~~

**I figured out why `“associationTypeId”: 202` worked:**

The Associations url needs to be specified correctly; the _`{fromObjectType}`_ and _`{toObjectType}`_ parts needs to be in the correct order. Since we’re associating a note to a contactthe URL to find the correct ID is (notice that _`/note`_ comes before _`/contact`_😞

_`GET [https://api.hubapi.com/crm/v4/associations/note/contact/labels\`](https://api.hubapi.com/crm/v4/associations/note/contact/labels%5C%60)_.

This returns:

```lia-code-sample
{
 "results": [
 {
 "category": "HUBSPOT_DEFINED",
 "typeId": 202,
 "label": null
 }
 ]
}

```

So in order to get the failed POST request to create a note on a contact you have to do the following:

```lia-code-sample
{
 "properties": {
 "hs_timestamp": "2023-02-12T15:48:22Z",
 "hs_note_body": "test note body"
 },
 "associations": [
 {
 "to": {
 "id": 123 // customer id
 },
 "types": [
 {
 "associationCategory": "HUBSPOT_DEFINED",
 "associationTypeId": 202 // note to contact typeId
 }
 ]
 }
 ]
}

```

---

<div class="post-metadata">

**Author:** ![lennart-sve](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lennart-sve/32/5494_2.png) [@lennart-sve](https://community.hubspot.com/u/lennart-sve)\
**Post date:** [November 29, 2023, 10:02am UTC](https://community.hubspot.com/t/error-while-create-contact-note/75487/5 "2023-11-29T10:02:15Z")

</div>

This put me on the right track for a very similar problem, thank you!

---

<div class="post-metadata">

**Author:** ![RHZaman](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RHZaman](https://community.hubspot.com/u/RHZaman)\
**Post date:** [March 31, 2023, 1:12pm UTC](https://community.hubspot.com/t/error-while-create-contact-note/75487/6 "2023-03-31T13:12:17Z")

</div>

The error is still there even after setting the ‘associationTypeId’ to 201. Any solution on this?
