# unauthorized error..

**URL:** <https://community.hubspot.com/t/unauthorized-error/64467>\
**Category:** APIs & Integrations\
**Tags:** php, oauth\
**Created:** [September 5, 2022, 3:50pm UTC](https://community.hubspot.com/t/unauthorized-error/64467 "2022-09-05T15:50:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NDK](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@NDK](https://community.hubspot.com/u/NDK)\
**Post date:** [September 5, 2022, 3:50pm UTC](https://community.hubspot.com/t/unauthorized-error/64467/1 "2022-09-05T15:50:41Z")

</div>

I’ve given my app read access to custom objects and that allows me to get all schemas, the request goes through but when I for some reason try to create a schema using the PHP client from hubspot, I get unauthorized error.

Why could this be happening? do I need the apikey to be able to create schema?

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [September 6, 2022, 4:21pm UTC](https://community.hubspot.com/t/unauthorized-error/64467/2 "2022-09-06T16:21:12Z")

</div>

@NDK

If you are using a private app, you will need to make sure that you are also giving it write access to the schema. Here is a [link to a video on creating a schema.](https://youtu.be/WU7QQgb1YXE)

If you are using a public app employing OAuth, you will need to apply to be able to do this [here](https://developers.hubspot.com/docs/api/custom-objects-schema-pilot)

---

<div class="post-metadata">

**Author:** ![NDK](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@NDK](https://community.hubspot.com/u/NDK)\
**Post date:** [September 7, 2022, 9:45am UTC](https://community.hubspot.com/t/unauthorized-error/64467/3 "2022-09-07T09:45:26Z")

</div>

@dennisedson I have a public app, the second link tells me to submit a request but the “submit” link only opens up a new tab and directs me to the same page.. thanks in advance.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [September 7, 2022, 1:34pm UTC](https://community.hubspot.com/t/unauthorized-error/64467/4 "2022-09-07T13:34:57Z")

</div>

@NDK , spoke with the team responsible for that page and they have updated so it shows an inline thank you instead now 🙂

Regardless, I believe you should have received an email confirmation. Let me know if you didn’t.

And thanks for the feedback!

---

<div class="post-metadata">

**Author:** ![NDK](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@NDK](https://community.hubspot.com/u/NDK)\
**Post date:** [September 9, 2022, 4:21pm UTC](https://community.hubspot.com/t/unauthorized-error/64467/5 "2022-09-09T16:21:07Z")

</div>

Hey dennis,

I clicked submit again, still doesn’t work.

As for the email confirmation, I haven’t gotten one yet, not that I can see anyway. How can I identify it if its for sure sent?

NDK

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [September 9, 2022, 5:23pm UTC](https://community.hubspot.com/t/unauthorized-error/64467/6 "2022-09-09T17:23:31Z")

</div>

@NDK , mind sending me the info you sent in that form in a dm? I will make sure it gets to the right place
