# Deal Association v4 endpoint internal error

**URL:** <https://community.hubspot.com/t/deal-association-v4-endpoint-internal-error/69633>\
**Category:** APIs & Integrations\
**Created:** [November 20, 2022, 3:37pm UTC](https://community.hubspot.com/t/deal-association-v4-endpoint-internal-error/69633 "2022-11-20T15:37:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![OsvaldoJ](https://avatars.discourse-cdn.com/v4/letter/o/6bbea6/32.png) [@OsvaldoJ](https://community.hubspot.com/u/OsvaldoJ)\
**Post date:** [November 20, 2022, 3:37pm UTC](https://community.hubspot.com/t/deal-association-v4-endpoint-internal-error/69633/1 "2022-11-20T15:37:41Z")

</div>

Hi,

I’m trying to associate a deal-to-contact using a basic http requests and it keeps failing with an internal error, status code 500.

curl -i -X PUT -H ‘Authorization: Bearer \_TOKEN\_’ [https://api.hubapi.com/crm/v4/objects/deals/11015101525/associations/contacts/34393001](https://api.hubapi.com/crm/v4/objects/deals/11015101525/associations/contacts/34393001)

HTTP/2 500

**date** : Sun, 20 Nov 2022 15:34:18 GMT

**content-type** : application/json;charset=utf-8

**content-length** : 100

**cf-ray** : 76d23fb8ed9608bc-EZE

**strict-transport-security** : max-age=31536000; includeSubDomains; preload

**vary** : origin

**cf-cache-status** : DYNAMIC

**access-control-allow-credentials** : false

**x-hubspot-correlation-id** : 95b64cea-2e05-412a-9357-9c21eff3e0c8

**x-hubspot-ratelimit-daily** : 1000000

**x-hubspot-ratelimit-daily-remaining** : 974635

**x-hubspot-ratelimit-interval-milliseconds** : 10000

**x-hubspot-ratelimit-max** : 200

**x-hubspot-ratelimit-remaining** : 199

**x-hubspot-ratelimit-secondly** : 20

**x-hubspot-ratelimit-secondly-remaining** : 19

**x-trace** : 2BBB79E9686A81AB1565425B2E0867BF1E1A587DF9000000000000000000

**report-to** : {“endpoints”:[{“url”:“https:\/\/a.nel.cloudflare.com\/report\/v3?s=Lv%2BGN6E4wSyk5%2BLb0ojKf8mjeS%2FLpY7PHOLVMhLrvFJ6Iccy2DfzpV7ykSYXwtdO4UHNay5AOsFmfmozEXOe%2F%2BMDifKlGUtVLRAlCjX5W3QtWIFYoWmYzgbRTFwQkD%2FI”}],“group”:“cf-nel”,“max\_age”:604800}

**nel** : {“success\_fraction”:0.01,“report\_to”:“cf-nel”,“max\_age”:604800}

**server** : cloudflare

**alt-svc** : h3=“:443”; ma=86400, h3-29=“:443”; ma=86400

---

<div class="post-metadata">

**Author:** ![tominal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tominal/32/73018_2.png) [@tominal](https://community.hubspot.com/u/tominal)\
**Post date:** [November 21, 2022, 1:20am UTC](https://community.hubspot.com/t/deal-association-v4-endpoint-internal-error/69633/2 "2022-11-21T01:20:35Z")

</div>

Hey @OsvaldoJ,

What does your payload look like? [In the docs](https://developers.hubspot.com/docs/api/crm/associations), there is a small payload associated with that request.

 ![tominal_0-1668993598408.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/1/71d68a7169fa44ff790890d5e6696e47bcb2756f.png)

---

<div class="post-metadata">

**Author:** ![OsvaldoJ](https://avatars.discourse-cdn.com/v4/letter/o/6bbea6/32.png) [@OsvaldoJ](https://community.hubspot.com/u/OsvaldoJ)\
**Post date:** [November 21, 2022, 6:56pm UTC](https://community.hubspot.com/t/deal-association-v4-endpoint-internal-error/69633/3 "2022-11-21T18:56:21Z")

</div>

Ohhh…

Going through the docs, from the **deals** page, the endpoint for association seems to refer to v3 even tho it says v4 and there’s no reference whatsoever about a payload.

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

Trying it, if it works i’ll come back and mark it as the solution.

Btw, the error should still be a 400 bad request, not a 500 internal error …

---

<div class="post-metadata">

**Author:** ![VJin](https://avatars.discourse-cdn.com/v4/letter/v/76d3ee/32.png) [@VJin](https://community.hubspot.com/u/VJin)\
**Post date:** [November 26, 2022, 3:42pm UTC](https://community.hubspot.com/t/deal-association-v4-endpoint-internal-error/69633/4 "2022-11-26T15:42:35Z")

</div>

@hubspot/api-client@8 upgraded to v4 which breaks the API…

> <https://github.com/HubSpot/hubspot-api-nodejs/blob/b351607de0c863aa9bc85bf8549fc15eaa73809a/codegen/crm/deals/apis/AssociationsApi.ts#L122>

---

<div class="post-metadata">

**Author:** ![OsvaldoJ](https://avatars.discourse-cdn.com/v4/letter/o/6bbea6/32.png) [@OsvaldoJ](https://community.hubspot.com/u/OsvaldoJ)\
**Post date:** [November 26, 2022, 3:47pm UTC](https://community.hubspot.com/t/deal-association-v4-endpoint-internal-error/69633/5 "2022-11-26T15:47:19Z")

</div>

Omg! Yep, same thing, documentation and hubspot nodejs library both use v3 definition (and no payload) with v4 endpoint…
