# Custom Objects with OAuth2

**URL:** <https://community.hubspot.com/t/custom-objects-with-oauth2/25581>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [September 17, 2020, 11:21am UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581 "2020-09-17T11:21:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kenan/32/79644_2.png) [@Kenan](https://community.hubspot.com/u/Kenan)\
**Post date:** [September 17, 2020, 11:21am UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/1 "2020-09-17T11:21:49Z")

</div>

Hallo,

I have a developer App which is authenticated with my portal. All Api requests are going through but when I try accessing custom objects with the access tokens i get a “403 Forbiden” with the following message:

```lia-code-sample
{
 "status": "error",
 "message": "App ******* is gated for custom CRM object types",
 "correlationId": "058b4d20-ba6c-4b22-b9d4-0accd5e5910a",
 "context": {
 "portalId": [
 " *******"
 ],
 "appId": [
 " *******"
 ]
 },
 "category": "GATED"
}

```

I gave the developer app all possible scopes and still got the same error.

What am i doing wrong? and is it possible to change the custom objects to free (ungated)?

Thanks  
Kenan Alsabbagh

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [September 21, 2020, 6:47am UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/2 "2020-09-21T06:47:34Z")

</div>

Hey @Kenan,

Currently, the custom object is in beta and will be roll out tomorrow and it is only available for Enterprise users.

Can I check if the portal that you’d installed the app on, is on a enterprise subscription?

If so, could you share with me the app ID and portal ID in question?

---

<div class="post-metadata">

**Author:** ![Kenan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kenan/32/79644_2.png) [@Kenan](https://community.hubspot.com/u/Kenan)\
**Post date:** [September 21, 2020, 6:58am UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/3 "2020-09-21T06:58:55Z")

</div>

Hi Wendy,

The entire thing should be rolled out as soon as possible on our enterprise subscription. But i am in the final testing stage on a test account. And custom objects are already available for us on both accounts (test and live).

Test System:

AppID: 227665  
PortalID: 7157252  
Thanks in advance  
Kenan Alsabbagh

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [September 22, 2020, 8:36am UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/4 "2020-09-22T08:36:59Z")

</div>

Hey @Kenan,

Thanks for providing further information.

Digging further into this, I was able to confirm that currently OAuth apps do not have create or edit access to custom objects, but they do have read access to the schemas. Therefore, if you are using OAuth to create the custom objects, a scope error will occur.

The reason is because giving apps create/edit access to schemas would allow apps to create custom objects for any portal in which they are installed. Custom objects are intended to be one-off and portal-specific. Allowing apps to create custom objects across any portal their app is installed in could lead to a messy experience for customers with many apps installed.

---

<div class="post-metadata">

**Author:** ![Kenan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kenan/32/79644_2.png) [@Kenan](https://community.hubspot.com/u/Kenan)\
**Post date:** [September 22, 2020, 9:17am UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/5 "2020-09-22T09:17:12Z")

</div>

Hi @WendyGoh,

Thank you for your answer.

Kenan Alsabbagh

---

<div class="post-metadata">

**Author:** ![nyergler](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nyergler/32/93181_2.png) [@nyergler](https://community.hubspot.com/u/nyergler)\
**Post date:** [September 28, 2020, 11:15pm UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/6 "2020-09-28T23:15:48Z")

</div>

Thanks for digging into this, @WendyGoh . I just burned an hour trying to figure out the same issue, would it be possible to get the documentation updated to reflect this? Right now the CRM Custom Objects Schema docs show that the call should work with OAuth, and list an OAuth scope for the schema mutation calls.

Thanks again for all the guidance on here!

Nathan

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [September 30, 2020, 9:34am UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/7 "2020-09-30T09:34:58Z")

</div>

Hey @nyergler,

Thanks for the feedback and I’ve passed it along to the internal team 🙂

---

<div class="post-metadata">

**Author:** ![HBhati](https://avatars.discourse-cdn.com/v4/letter/h/ba8739/32.png) [@HBhati](https://community.hubspot.com/u/HBhati)\
**Post date:** [July 22, 2022, 9:52am UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/8 "2022-07-22T09:52:33Z")

</div>

Hi @WendyGoh  
Do OAuth access tokens have access now to create or edit access to custom objects?

---

<div class="post-metadata">

**Author:** ![Tim\_Munro](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tim_munro/32/87893_2.png) [@Tim\_Munro](https://community.hubspot.com/u/Tim_Munro)\
**Post date:** [October 5, 2020, 2:06am UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/9 "2020-10-05T02:06:32Z")

</div>

Hey @WendyGoh - in HubSpot test portals (e.g. portal 8582993) this same error message is returned when using OAuth to list (GET) records from CRM Custom Objects. Example:

> * * *

_GET [https://api.hubapi.com/crm/v3/objects/p8582993\_my\_object?limit=100&properties=hs\_all\_accessible\_team\_ids%2Chs\_created\_by\_user\_id%2Chs\_createdate%2Chs\_lastmodifieddate%2Chs\_merged\_object\_ids%2Chs\_object\_id%2Chs\_updated\_by\_user\_id%2Chs\_user\_ids\_of\_all\_owners%2Cmy\_object\_property](https://api.hubapi.com/crm/v3/objects/p8582993_my_object?limit=100&properties=hs_all_accessible_team_ids%2Chs_created_by_user_id%2Chs_createdate%2Chs_lastmodifieddate%2Chs_merged_object_ids%2Chs_object_id%2Chs_updated_by_user_id%2Chs_user_ids_of_all_owners%2Cmy_object_property)_

I dont believe that is correct/expected as according to the documentation OAuth authenticated API calls should be able to read/write records. Making the same call using the API key works OK. These are the scopes that were granted to when running this test:

_contacts crm.objects.custom.read crm.objects.custom.write crm.schemas.custom.read_

When authorizing the app it indicates that read/write custom object records permissions is being granted to the App.

Have I missed something here, e.g. is there an App approval process needed?

Thanks, Tim

---

<div class="post-metadata">

**Author:** ![davidoff2drew](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/davidoff2drew/32/80657_2.png) [@davidoff2drew](https://community.hubspot.com/u/davidoff2drew)\
**Post date:** [October 5, 2020, 5:39pm UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/10 "2020-10-05T17:39:07Z")

</div>

@WendyGoh I gotta ask, if this isn’t possible, why is there an app on the right now marketplace that does all of these things?

---

<div class="post-metadata">

**Author:** ![Tim\_Munro](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tim_munro/32/87893_2.png) [@Tim\_Munro](https://community.hubspot.com/u/Tim_Munro)\
**Post date:** [October 6, 2020, 2:55am UTC](https://community.hubspot.com/t/custom-objects-with-oauth2/25581/11 "2020-10-06T02:55:47Z")

</div>

For the benefit of others, as of today OAuth based querying of custom objects records is now working.
