API requires API key, but can't create API Key

I attempted to make an API call to

POST /crm/v3/schemas/{objectType}/associations

using a private app token but I received the following error:

{ “status”: “error”, “message”: “The scope needed for this API call isn’t available for public use. If you have questions, contact support or post in our developer forum.”, “correlationId”: “bc8b3899-9abd-47a2-9f93-b88032927a8c”, “links”: { “support”: “https://help.hubspot.com/”, “forum”: “https://community.hubspot.com/t5/APIs-Integrations/bd-p/integrations” }, “category”: “MISSING_SCOPES” }

Other posts on this forum indicate that some API calls only support API key authentication, and not private app tokens. I was able to confirm this was the problem when I was able to make the API call when using my production account’s API key.

The problem is that I’m trying to make the same API call in my Sandbox account and I’m not able to do it because I didn’t generate an API key before the cutoff on June 15, 2022.

Is there a way to make the API call in my Sandbox account without the API key, or will I simply be unable to make those API calls? Will those API calls be unavailable once the API keys are permently disabled?

Hi @PD_,

Thank you for reaching out to the Community and for sharing the error message. That’s very helpful!

This error message can mean that the call does not work with OAuth for private apps since the scopes are not available yet.

I would like to confirm this internally though, could you help me out with the following information, please?

  • A link to the developer documentation you are referrencing
  • The full request URL
  • The full request response

Thank you!

Best,

Kristen

I’ve added the information requested below.

Documentation URL: Accounts Dashboard | HubSpot

Specifically the section in the “Object Schema” tab, and the section entitled “Create an association”

Request URL: https://api.hubapi.com/crm/v3/schemas/2-9115561/associations

Request HTTP Method: POST

Authentication: Private App Token
Request Body:

{
“fromObjectTypeId”: “2-9115561”,
“toObjectTypeId”: “line_item”,
“name”: “license_to_line_item”
}

Response Body:

{“status”:“error”,“message”:“The scope needed for this API call isn’t available for public use. If you have questions, contact support or post in our developer forum.”,“correlationId”:“daf8c3ea-c008-44fe-a653-f71309e84cf7”,“links”:{“support”:“https://help.hubspot.com/",“forum”:“https://community.hubspot.com/t5/APIs-Integrations/bd-p/integrations”},“category”:"MISSING\_SCOPES”}

I was reading through the API documentation and noticed that the “Create an association” section had been updated to include “Private Apps” as an authentication method.

I tried to create an association with my private app token and the API call succeeded instead of responding with an error. Thanks, HubSpot team, for updating that.

Thank you for sharing this with us, @PD_!

Glad to hear that update helps you achieve your goal :slightly_smiling_face:

Best,

Kristen