Custom Object API Key

I’m trying to set up a custom object in my demo portal to get more of an understanding of how custom objects work for my personal development.

I’ve followed the schema set-up here: Accounts Dashboard | HubSpot

As API keys have been sunsetted I’ve set up a private app labelled Fields_Custom_Object and gave it scope for all read & writing options.

However when I run the schema it comes up with an error that my API key is invalid. Can anyone please advise?

Thanks!

Can you provide the code of your call? Did you make sure to implement the new key differently than the old key. The new key goes in an authorization header.

HI @LeeBartelme I got the same issue
Here is the code:
curl --request POST \
--url ‘https://api.hubapi.com/crm/v3/schemas?hapikey=YOUR_ACCESS_TOKEN’ \
--header ‘content-type: application/json’ \
--data ‘{
“labels”: {
“singular”: "Plausible ",
“plural”: “Plausile”
},
“requiredProperties”: [
“Device”
],
“secondaryDisplayProperties”: [
“Country”
],
“properties”: [
{
“name”: “device”,
“label”: “Device”,
“isPrimaryDisplayLabel”: true,
“type”: “string”
}
],
“associatedObjects”: [
“CONTACT”
],
“name”: “Plausible”,
“primaryDisplayProperty”: “Device”,
“metaType”: “PORTAL_SPECIFIC”
}’
Thank you in advance!

I don’t know why the documentation currently doesn’t have the example correct. But the private app key should go as a header. See other endpoints for similar examples of token usage.

curl --request POST \
--url 'https://api.hubapi.com/crm/v3/schemas' \
--header 'content-type: application/json' \
--header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
--data '{
"labels": {
"singular": "Plausible ",
"plural": "Plausile"
},
"requiredProperties": [
"Device"
],
"secondaryDisplayProperties": [
"Country"
],
"properties": [
{
"name": "device",
"label": "Device",
"isPrimaryDisplayLabel": true,
"type": "string"
}
],
"associatedObjects": [
"CONTACT"
],
"name": "Plausible",
"primaryDisplayProperty": "Device",
"metaType": "PORTAL_SPECIFIC"
}'

Thank you!

Forgive me I figured it out. I simply needed to select the four custom object options in the scope (nothing else) and then use Postman to push it live.

Thanks all for your contributions.