# Association Batch error

**URL:** <https://community.hubspot.com/t/association-batch-error/121744>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [December 2, 2024, 9:24pm UTC](https://community.hubspot.com/t/association-batch-error/121744 "2024-12-02T21:24:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DGrant5](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@DGrant5](https://community.hubspot.com/u/DGrant5)\
**Post date:** [December 2, 2024, 9:24pm UTC](https://community.hubspot.com/t/association-batch-error/121744/1 "2024-12-02T21:24:08Z")

</div>

Hello, when I try to api call to delete an association I have between my objects Contact and Event I get this error:  
Invalid input JSON on line 1, column 62: Cannot deserialize value of type `java.util.ArrayList\<com.hubspot.apiutils.core.models.PublicObjectId\>` from Object value (token `JsonToken.START_OBJECT`)

My jsonString:  
[  
{  
“from”: {  
“id”: “80674213188”  
},  
“to”: {  
“id”: “20226914952”  
}  
}  
]

---

<div class="post-metadata">

**Author:** ![SteveHTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stevehtm/32/22074_2.png) [@SteveHTM](https://community.hubspot.com/u/SteveHTM)\
**Post date:** [December 3, 2024, 4:07pm UTC](https://community.hubspot.com/t/association-batch-error/121744/2 "2024-12-03T16:07:49Z")

</div>

@DGrant5 - I think you may be missing the ‘inputs’ JSON array element on the structure here. My read is that the structure should be:

```lia-code-sample
{
 "inputs": [
 {
 "from": {
 "id": "string"
 },
 "to": [
 {
 "id": "string"
 }
 ]
 }
 ]
}

```

Best of luck!

Steve

---

<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:** [December 4, 2024, 12:26pm UTC](https://community.hubspot.com/t/association-batch-error/121744/3 "2024-12-04T12:26:53Z")

</div>

Hi @DGrant5

here is the curl to delete the association between 2 objects.

```lia-code-sample
curl --request POST \
 --url https://api.hubapi.com/crm/v4/associations/fromObjectType/toObjectType/batch/labels/archive \
 --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
 --header 'content-type: application/json' \
 --data '{
 "inputs": [
 {
 "types": [
 {
 "associationCategory": "HUBSPOT_DEFINED",
 "associationTypeId": 0
 }
 ],
 "from": {
 "id": "string"
 },
 "to": {
 "id": "string"
 }
 }
 ]
}' 

```

link address -

**[Accounts Dashboard | HubSpot](https://developers.hubspot.com/beta-docs/reference/api/crm/associations/association-details)**

make sure you use the correct association type and correct ID

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.  
Thanks!
