Issues creating a new custom object schema

Hello,

I’m trying to create a new custom object type using an API call, doing POST to https://api.hubapi.com/crm/v3/schemas via Postman. I’m using a private app token, and am adding that auth as Bearer-type (and I have made other calls using this method just fine).

I am trying this in a Sandbox. Not sure if that makes a difference?

I get…

“The scope needed for this API call isn’t available for public use.”

..and also…

“MISSING_SCOPES”

I do have both crm.custom.read and crm.custom.write granted to my token.

The body of my request is currently this (I’ve scaled it down to keep it simple since I kept getting errors but naturally the plan is to expand the definition once I get this sorted):

{

“name”: “retailer”,

“labels”: {

“singular”: “Retailer”,

“plural”: “Retailers”

},

“primaryDisplayProperty”: “name”,

“secondaryDisplayProperties”: [

“website”

],

“searchableProperties”: [

“name”

],

“requiredProperties”: [

“name”

],

“properties”: [

{

“name”: “name”,

“label”: “Name”,

“type”: “string”,

“fieldType”: “text”

},

{

“name”: “website”,

“label”: “Website URL”,

“type”: “string”,

“fieldType”: “text”

}

],

“associatedObjects”: [

“COMPANY”

]

}

Any ideas what might be the issue?

Are you doing this in a tool like Postman or in some code. Can you post your full code or cURL reuqest from Postman to help diagnose.

Yes, using Postman. Here is the cURL req:

curl --location --request POST ‘https://api.hubapi.com/crm/v3/schemas’ \
--header ‘Authorization: Bearer XXXXXXXXXXXXXXX’ \
--header ‘Content-Type: application/json’ \
--data-raw ‘{
“name”: “retailer”,
“labels”: {
“singular”: “Retailer”,
“plural”: “Retailer”
},
“primaryDisplayProperty”: “name”,
“secondaryDisplayProperties”: [
“website”
],
“searchableProperties”: [
“name”
],
“requiredProperties”: [
“name”
],
“properties”: [
{
“name”: “name”,
“label”: “Name”,
“type”: “string”,
“fieldType”: “text”
},
{
“name”: “website”,
“label”: “Website URL”,
“type”: “string”,
“fieldType”: “text”
}
],
“associatedObjects”: [
“COMPANY”
]
}’

Are you using a private app or trying to use public app? Did you ensure you added the scopes to your private app. I don’t think you can add the scope to a public app.