APIs & Integrations

Graham-OUB
Member

Unable to PATCH Schema

Hello everyone

 

I’m encountering an issue with a Custom Schema update while using the HubSpot PHP SDK (v10). I’ve been successfully using this functionality for years, but today it suddenly stopped working, and I’m now receiving a 404 error related to an unrecognised scope.

 

The URL I am using:

PATCH https://api.hubapi.com/crm/v3/schemas/{objectName}

 

The (partial) error response:

{
"status": "error",
"message": "cobject-edit-all-1 is not a valid scope"
}

 

At random intervals, I’ve also seen a similar 404 error with the following message:

{
"status": "error",
"message": "cobject-edit-team-owned-1 is not a valid scope"
}

 

I’m struggling to identify what these scopes (cobject-edit-all-1 and cobject-edit-team-owned-1) are or how to resolve the issue. I’ve reviewed the available scopes in HubSpot’s documentation but haven’t found anything that matches.

 

Here are the scopes currently applied:

  • crm.schemas.custom.read
  • crm.objects.custom.read
  • crm.objects.custom.write
  • crm.schemas.custom.write

Has anyone encountered this issue before or can shed light on what these error messages mean? Any guidance on how to resolve this would be greatly appreciated!

5 Replies 5
zach_threadint
Guide

Unable to PATCH Schema

Hi @Graham-OUB 👋

 

I've not come across this error message before. Would you please share an example of a request body that is leading to these errors?

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes
Graham-OUB
Member

Unable to PATCH Schema

Hi @zach_threadint 👋

 

I've gone into the PHP SDK and dumped the JSON payload before it sends the request, below is the payload which is producing the above error. 

 

{"requiredProperties":[],"searchableProperties":["oub_ref","formatted_address"],"primaryDisplayProperty":"oub_ref","secondaryDisplayProperties":["formatted_address"]}

 This morning, when I attempted the request again, I got new, slightly different error message:

 

cobject-delete-owned-1 is not a valid scope

Hope that helps!

Thanks for your help

0 Upvotes
zach_threadint
Guide

Unable to PATCH Schema

Hi @Graham-OUB 👋

 

Thanks for sharing the additional information. I've been able to replicate the issue you're experiencing and agree there seems to be an issue with this endpoint.

 

@Jaycee_Lewis @BérangèreL Would you please take a look at this? It's the "Update a schema" endpoint: https://developers.hubspot.com/docs/reference/api/crm/objects/schemas

 

I've tried multiple different approaches, but it seems even the simplest call to update an existing custom object's schema is resulting in an error similar to that described by @Graham-OUB. Thanks 🙌

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Unable to PATCH Schema

Hey, @zach_threadint 👋 Thanks for the tag. I'll get this added to my tasks. I'll update here or post any additional requests I get. — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

Graham-OUB
Member

Unable to PATCH Schema

Thanks @Jaycee_Lewis and @zach_threadint for looking into this, much appreicated. 

 

Let me know if you need anymore information from me.