# Invalid Authentication for v4 associations

**URL:** <https://community.hubspot.com/t/invalid-authentication-for-v4-associations/130270>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [April 22, 2025, 10:19am UTC](https://community.hubspot.com/t/invalid-authentication-for-v4-associations/130270 "2025-04-22T10:19:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Jelmer](https://avatars.discourse-cdn.com/v4/letter/_/c6cbf5/32.png) [@\_Jelmer](https://community.hubspot.com/u/_Jelmer)\
**Post date:** [April 22, 2025, 10:19am UTC](https://community.hubspot.com/t/invalid-authentication-for-v4-associations/130270/1 "2025-04-22T10:19:44Z")

</div>

Hi,

I have been using the HS API’s for a while now, but now run into an issue using an API we have not used before (the V4 associations API’s).

In Basics, we wanted to start with something simple, just to retrieve all ticket IDs linked to a certain company.

For most of our API-projects we use Google Sheets / Google App Script, which has workedf for us for past projects.

Code we have tried:

```lia-code-sample
function getLinkedTickets(){
 var comp = //removed company ID
 const options = {
 "method" : "GET",
 "muteHttpExceptions": true,
 "headers": {
 "Content-Type": "application/json",
 "Authorization": "Bearer pat-na1-REMOVED_API_KEY",
 }
 };
 var r = UrlFetchApp.fetch("https://api.hubspot.com/crm/v4/objects/Company/" + comp + "/associations/Ticket", options);
 let x = JSON.parse(r);
	 console.log(x)
}

```

This yields the following error:

```lia-code-sample
{ status: 'error',
 message: 'Authentication credentials not found. This API supports OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview',
 correlationId: '',
 category: 'INVALID_AUTHENTICATION' }

```

Things we tried:

- Generate a new API token with more/all permissions

- Use the V3 API (yielded the same error)

Anyone able to point us in the right direction?

---

<div class="post-metadata">

**Author:** ![Jigar\_Thakker](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jigar_thakker/32/63606_2.png) [@Jigar\_Thakker](https://community.hubspot.com/u/Jigar_Thakker)\
**Post date:** [April 22, 2025, 10:39am UTC](https://community.hubspot.com/t/invalid-authentication-for-v4-associations/130270/2 "2025-04-22T10:39:12Z")

</div>

Hi [@\_Jelmer](https://community.hubspot.com/t5/user/viewprofilepage/user-id/529349) ,

The above issue is because HubSpot’s CRM v4 associations API doesn’t support Private App Token and mandatorily requires OAuth 2.0 authentication.

- To resolve this u

- If you require v4 this requires OAuth 2.0 which needs to be implemented

This should help resolve your authentication issue. If this helps, feel free to mark it as the solution

✔

and give it an upvote

👍

!

---

<div class="post-metadata">

**Author:** ![\_Jelmer](https://avatars.discourse-cdn.com/v4/letter/_/c6cbf5/32.png) [@\_Jelmer](https://community.hubspot.com/u/_Jelmer)\
**Post date:** [April 22, 2025, 10:51am UTC](https://community.hubspot.com/t/invalid-authentication-for-v4-associations/130270/3 "2025-04-22T10:51:04Z")

</div>

EDIT: after some puzzling around it suddenly worked wit the v3 API, not sure what changed but we will take it from here. Thanks!

---------------------------------------------------------

Thanks for the quick reply, but even with the V3 API we get the same error, could it be that the v3 API was also upgraded to Oauth2?

```lia-code-sample
function getLinkedTickets(){
 var comp = "REMOVED";
 let bc ={
 "inputs":[
 {
 "id":comp
 },
 {
 "id":comp
 }
 ]
 }
 const options = {
 "method" : "POST",
 "muteHttpExceptions": true,
 "headers": {
 "Content-Type": "application/json",
 "Authorization": "Bearer pat-na1-API TOKEN",
 },
 "payload": JSON.stringify(bc)
 };
 var r = UrlFetchApp.fetch("https://api.hubspot.com/crm/v3/associations/Company/Ticket/batch/read", options);
 let x = JSON.parse(r);
	 console.log(x)
}

```

This code yields the exact same error
