# Notes create v3, 400 error with cryptic message

**URL:** <https://community.hubspot.com/t/notes-create-v3-400-error-with-cryptic-message/84925>\
**Category:** APIs & Integrations\
**Tags:** starter\
**Created:** [July 7, 2023, 9:58pm UTC](https://community.hubspot.com/t/notes-create-v3-400-error-with-cryptic-message/84925 "2023-07-07T21:58:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff00seattle](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jeff00seattle](https://community.hubspot.com/u/jeff00seattle)\
**Post date:** [July 7, 2023, 9:58pm UTC](https://community.hubspot.com/t/notes-create-v3-400-error-with-cryptic-message/84925/1 "2023-07-07T21:58:50Z")

</div>

I am using Notes API

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

Goal to create a new Note with the uploaded document ID as an attachment:

- Document ID: [ID]
- Owner ID: [ID] (myself)
- Company Object ID: [ID]

```lia-code-sample
curl --request POST \
 --url https://api.hubapi.com/crm/v3/objects/notes \
 --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
 --header 'content-type: application/json' \
 --data '{
 "properties": {
 "hs_timestamp": "2023-07-07T20:41:10Z",
 "hs_note_body": "TEST NOTE",
 "hs_attachment_ids": "[ID]",
 "hubspot_owner_id": "[ID]"
 },
 "associations": [
 {
 "to": {
 "id": "[ID]"
 },
 "types": [
 {
 "associationCategory": "HUBSPOT_DEFINED",
 "associationTypeId": 2
 }
 ]
 }
 ]
}'

```

Returns this error response, and I have no clue what it means:

```lia-code-sample
HTTP 400

{
 "status": "error",
 "message": "invalid from object type 0-46 for associations to be created. expected: 0-2",
 "correlationId": "[ID]",
 "category": "VALIDATION_ERROR"
}

```

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [July 10, 2023, 9:43am UTC](https://community.hubspot.com/t/notes-create-v3-400-error-with-cryptic-message/84925/2 "2023-07-10T09:43:41Z")

</div>

Hi @jeff00seattle

The error response you received indicates that there is an issue with the association object type specified in your request. Let’s break down the error message and suggest a possible solution:

Error: “invalid from object type 0-46 for associations to be created. expected: 0-2”

This error message suggests that the “from object type” you specified for the association is invalid. The expected range for the “from object type” is between 0 and 2.

To resolve this issue, you should ensure that you are providing the correct object type in the association. Based on the code you provided, it appears you are trying to associate the note with a company object. The correct object type for a company in HubSpot is 1.

Here’s an updated version of the request with the correct object type for the association:

```curl  
curl --request POST \  
--url [https://api.hubapi.com/crm/v3/objects/notes](https://api.hubapi.com/crm/v3/objects/notes) \  
--header ‘authorization: Bearer YOUR\_ACCESS\_TOKEN’ \  
--header ‘content-type: application/json’ \  
--data ‘{  
“properties”: {  
“hs\_timestamp”: “2023-07-07T20:41:10Z”,  
“hs\_note\_body”: “TEST NOTE”,  
“hs\_attachment\_ids”: “[ID]”,  
“hubspot\_owner\_id”: “[ID]”  
},  
“associations”: [  
{  
“to”: {  
“id”: “[ID]”,  
“type”: “COMPANY”  
}  
}  
]  
}’  
```

In this updated request, the association object now includes the correct type `“type”: “COMPANY”`.

Make sure to replace `[ID]` with the appropriate values for the document ID, owner ID, and company object ID in the request.

By making these adjustments, you should be able to create a new note with the uploaded document ID as an attachment associated with the specified company object.

Hope this will helps you out. Please mark it as **Solution Accepted & Upvote** to help other Community member.  
Thanks!
