# creating custom object using private app token

**URL:** <https://community.hubspot.com/t/creating-custom-object-using-private-app-token/61681>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [July 25, 2022, 8:14pm UTC](https://community.hubspot.com/t/creating-custom-object-using-private-app-token/61681 "2022-07-25T20:14:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![PBaranov](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@PBaranov](https://community.hubspot.com/u/PBaranov)\
**Post date:** [July 25, 2022, 8:14pm UTC](https://community.hubspot.com/t/creating-custom-object-using-private-app-token/61681/1 "2022-07-25T20:14:11Z")

</div>

Hi,

Trying to create a custom object:

`curl --request POST --url https://api.hubapi.com/crm/v3/objects/campaign --header 'authorization: Bearer ............' --header 'content-type: application/json' --data '{"properties": {"property_string":"campaign_name"}}'`

And getting back:

`{"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":"82ceaf50-b139-4e58-a7c6-9da301e1bbf7","links":{"support":"https://help.hubspot.com/","forum":"https://community.hubspot.com/t5/APIs-Integrations/bd-p/integrations"},"category":"MISSING_SCOPES"}`

Our Private App has all possible Scopes enabled.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [July 25, 2022, 10:34pm UTC](https://community.hubspot.com/t/creating-custom-object-using-private-app-token/61681/2 "2022-07-25T22:34:54Z")

</div>

Hey, @PBaranov! Thanks for reaching out. Our team just put out this guide — [How to Build a Custom Object Using Private Apps](https://developers.hubspot.com/blog/how-to-build-a-custom-object-using-private-apps)

Can you try following the steps by step there and letting me know if you can get the example working as expected, please?

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![PBaranov](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@PBaranov](https://community.hubspot.com/u/PBaranov)\
**Post date:** [July 25, 2022, 11:49pm UTC](https://community.hubspot.com/t/creating-custom-object-using-private-app-token/61681/3 "2022-07-25T23:49:03Z")

</div>

I’ve successfully created a new Schema:

```lia-code-sample
curl --request POST --url https://api.hubapi.com/crm/v3/schemas --header 'authorization: Bearer #################' --header 'content-type: application/json' --data '{
 "labels": {
 "singular": "Campaign",
 "plural": "Campaigns"
 },
 "requiredProperties": [
 "campaign_name",
 "campaign_friend_name"
 ],
 "searchableProperties": [
 "campaign_name",
 "campaign_friend_name"
 ],
 "properties": [
 {
 "name": "campaign_name",
 "label": "campaign Name",
 "isPrimaryDisplayLabel": true,
 "type": "string",
 "fieldType": "text"
 },
 {
 "name": "campaign_friend_name",
 "label": "campaign Friend Name",
 "type": "string",
 "fieldType": "text"
 }
 ],
 "associatedObjects": [
 "CONTACT"
 ],
 "name": "campaign_name",
 "primaryDisplayProperty": "campaign_name",
 "metaType": "PORTAL_SPECIFIC"
}'

```

But I’m still not able to create a new object:

```lia-code-sample
curl --request POST \
 --url https://api.hubapi.com/crm/v3/objects/campaign \
 --header 'authorization: Bearer #############################' \
 --header 'content-type: application/json' \
 --data '{
 "properties": {
 "campaign_name": "op_campaign_01",
 "campaign_friend_name": "campaign 01 friendly name"
 }
}'

```

I get back the same 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":"f41082a8-796a-4f1f-8d93-09d11216bfdc","links":{"support":"https://help.hubspot.com/","forum":"https://community.hubspot.com/t5/APIs-Integrations/bd-p/integrations"},"category":"MISSING_SCOPES"}`

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [July 26, 2022, 4:04pm UTC](https://community.hubspot.com/t/creating-custom-object-using-private-app-token/61681/4 "2022-07-26T16:04:00Z")

</div>

Hey, @PBaranov. Thank you for clarifying. I am trying to reproduce the issue on my end. Once I get it to throw the same, or a similar, warning, I’ll reach out to my internal resources. — Jaycee

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [July 26, 2022, 5:01pm UTC](https://community.hubspot.com/t/creating-custom-object-using-private-app-token/61681/5 "2022-07-26T17:01:16Z")

</div>

Hey, @PBaranov. Quick request. In your payload can you use objectType and not the custom object label, please?

Here’s what I did:

- followed this guide to create the [custom object schema](https://developers.hubspot.com/blog/how-to-build-a-custom-object-using-private-apps)  
I used only the four scopes used in the article

- This created the object Boats with the objectType of 2-7913954

- I used the endpoint — [Create](https://developers.hubspot.com/docs/api/crm/crm-custom-objects)  
`POST /crm/v3/objects/{objectType}​`

- Which returns the response of HTTP 201

- My request

- The response

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![PBaranov](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@PBaranov](https://community.hubspot.com/u/PBaranov)\
**Post date:** [July 26, 2022, 5:08pm UTC](https://community.hubspot.com/t/creating-custom-object-using-private-app-token/61681/6 "2022-07-26T17:08:52Z")

</div>

Using “objectType of 2-7913954” worked. Thank you!

---

<div class="post-metadata">

**Author:** ![diepak](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@diepak](https://community.hubspot.com/u/diepak)\
**Post date:** [September 15, 2022, 1:35pm UTC](https://community.hubspot.com/t/creating-custom-object-using-private-app-token/61681/7 "2022-09-15T13:35:42Z")

</div>

It is showing "

Invalid object or event type id: 2-7913954" for me.
