# Create engagement note with api

**URL:** <https://community.hubspot.com/t/create-engagement-note-with-api/76001>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [February 26, 2023, 11:08am UTC](https://community.hubspot.com/t/create-engagement-note-with-api/76001 "2023-02-26T11:08:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBircher](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sbircher/32/197846_2.png) [@SBircher](https://community.hubspot.com/u/SBircher)\
**Post date:** [February 26, 2023, 11:08am UTC](https://community.hubspot.com/t/create-engagement-note-with-api/76001/1 "2023-02-26T11:08:57Z")

</div>

I’m just trying to create a note using the engagement api, I’ve looked at examples and it should work but I keep getting the error:

Invalid input JSON on line 8, column 21: Cannot deserialize value of type `java.util.ArrayList\<com.hubspot.crmpublic.core.models.associations.PublicAssociationsForObject\>` from Object value (token `JsonToken.START_OBJECT`)  
this is my payload:

{

“engagement”: {

“active”: true,

“ownerId”: 251,

“type”: “NOTE”,

“timestamp”: 1409172644778

},

“associations”: {

“contactIds”: [

251

],

“companyIds”: [],

“dealIds”: [],

“ownerIds”: []

},

“metadata”: {

“body”: “this is an example note”

}

}

Any help would be most appreciated - thanks

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [February 27, 2023, 9:22am UTC](https://community.hubspot.com/t/create-engagement-note-with-api/76001/2 "2023-02-27T09:22:35Z")

</div>

Hello @SBircher  
It look like error you received indicates that there is an issue with deserializing the JSON payload you provided. Specifically, it looks like there is an issue with the `associations` field. Based on the error message, it seems that the API is expecting an array of `PublicAssociationsForObject`, but instead it received a JSON object.  
To fix this issue, you may need to update your payload to include an array for the `contactIds` field:

```lia-code-sample
{
 "engagement": {
 "active": true,
 "ownerId": 251,
 "type": "NOTE",
 "timestamp": 1409172644778
 },
 "associations": {
 "contactIds": [251],
 "companyIds": [],
 "dealIds": [],
 "ownerIds": []
 },
 "metadata": {
 "body": "this is an example note"
 }
}

```

Note that the `contactIds` field now includes an array with a single value, instead of a single value. This should help the API properly deserialize your payload.

Thanks & Regards  
Himanshu Rauthan

---

<div class="post-metadata">

**Author:** ![SBircher](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sbircher/32/197846_2.png) [@SBircher](https://community.hubspot.com/u/SBircher)\
**Post date:** [February 27, 2023, 5:49pm UTC](https://community.hubspot.com/t/create-engagement-note-with-api/76001/3 "2023-02-27T17:49:25Z")

</div>

Thanks for the reply Himanshu - I’ll give it a go later
