I figured it out - the private app needs to be recreated after enterprise is activated, or you get these weird permission errors for some of the custom object endpoints (but not all). Thanks for your assistance!
I had this issue, and it was resolved by creating a new private app and token after enterprise was activated on the account, the private app that was created before the enterprise trial was activated does not work. YMMV but it WorkedForMe TM
I had this issue, and it was resolved by creating a new private app and token after enterprise was activated on the account, the private app that was created before the enterprise trial was activated does not work. YMMV but it WorkedForMe TM
Sep 27, 20229:36 AM - edited Sep 27, 20229:40 AM
HubSpot Employee
Custom Object Schema Creation
SOLVE
I have no problem creating a custom object using my private app token. Are you sure you have at least one enterprise hub (custom objects are limited to enterprise tiers) and you are using the private app token correctly (as a header)?
That being said the beta should be accessible in your portal to create custom objects from the UI. Navigate to the "Product Updates" link in the dropdown in the top right of your potal. If you click on "Betas" you should see one labeled "Manage and Visualize Your Data Model". If you join that beta, you should be able to create custom objects from the portal settings.
Hi, is there a reason that this would not work on trial enterprise accounts? It's hard to evaluate if enterprise is worth it if a USP does not work in the trial, and it seems no schema interaction works using private apps on a trial enterprise account?
Can you share your code (with your Access Token removed) so we can see exactly what you are doing? I was able to create using the API and Access token using a trial enterprise hub.
Can you try doing it just from like Postman? Just trying to see maybe if it's a client library thing? Also, I'm not familiar with Python at all. Just JS.
curl --request POST \
--url 'https://api.hubapi.com/crm/v3/schemas' \
--header 'content-type: application/json' \
--header 'authorization: Bearer $TOKEN' \
--data '{
"name": "my_object",
"labels": {
"singular": "My object",
"plural": "My objects"
},
"primaryDisplayProperty": "my_object_property",
"requiredProperties": [
"my_object_property"
],
"properties": [
{
"name": "my_object_property",
"label": "My object property",
"isPrimaryDisplayLabel": true
}
],
"associatedObjects": [
"CONTACT"
],
"metaType": "PORTAL_SPECIFIC"
}'
{"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":"96e40266-00fd-4597-9bff-94bc4a9bc079","links":{"support":"https://help.hubspot.com/","forum":"https://community.hubspot.com/t5/APIs-Integrations/bd-p/integrations"},"category":"MISSING_SCOPES"}⏎
I don't know why on the example post request for the method they only list API Key. I'm just telling you it works in my own portal and a trial portal I have. I have postman setup and I'm not using API Keys and I'm able to create new custom objects just fine. They also list clearly the migration information on that page. It is supposed to work with private apps.
So I'm trying to isolate your issue to code or something else. If it works in Postman, we know it's code related. If it doesn't work in Postman, we know is' account, configuration, token related.
So in that case I'm not sure I can help. Below is my curl generated from Postman. There must be something else going on with the private app permissions or something I don't really know. The app I used had the following permissions.
It was a trial with marketing ent and sales ent trial. But either should get you custom objects (obviously since you can make them in the UI).
All I'd suggest at this point is to maybe create a new private app and grant it everything and just "see" if it works. I really don't know. Based on what I can see, it should work.
But as an aside, with the UI you really don't need that API anyway. It's no longer needed with it now being in the UI.
I figured it out - the private app needs to be recreated after enterprise is activated, or you get these weird permission errors for some of the custom object endpoints (but not all). Thanks for your assistance!
Cool, in that case, I would think rotating the token might have worked as well. (Possibly not). It might be worth testing if you still have the old app running. If you do try rotating the token and it works, let me know. Rotating the token I would think, would refresh all those permissions behind the scenes.
I tried rotating the key on the old app earlier, and again just now, but no difference - I re-checked the scopes as well and they match exactly on the new (working) app and the old one.
There is a pilot that you have to request access to allowing you to use OAuth to create schemas. That is the only good solution that I can see at this moment.
API keys are being sunsetted, so I am not sure what is going to happen with schema creation...
Creating a schema with a private app key results in this error:
I don't have any ideas but have the 'not available for public use'issue if using curl, and the "Authentication credentials not found" if I use the Python client library.