Hi, I need to retrieve a list of all custom objects that exist in a HubSpot account. There isn’t any documented endpoint for this but I have seen there is a CRM Custom Objects permission when creating an API token.
I wonder if there is some undocumented endpoint that does this.
To do this you can use the Custom Object API. There are two parts to this API. The first is the Object schema endpoints which allow you to pull the object definitions i.e the blueprints for the custom objects.
Making a request to this will return the objectTypeIds (along with a ton of other metadata relating to your custom objects.
The other is the object endpoints which I believe is what you require. This allows you to pull all of the custom objects of a specific schema. We can use the objectTypeId from the custom object schema endpoints to facilitate this request.
So for instance in my portal I have a custom object created to hold information related to “Licenses”. The objectTypeId is “2-116144016” I can retrieve all objects of this type by making a call similar to the below:
You can also do that. The below will return all of the information relating to your custom object definitions. So in my portal I have two types of custom object “Licenses” and “Shipments”. The request below pulls details relating to those object types.
Here is what I found:
You will have to do separate calls, one for the custom objects and one for each standard objec (Contacts, Companies, Deals and Tickets).
For standard objects use:
GET /crm/v3/schemas/contacts
GET /crm/v3/schemas/companies
GET /crm/v3/schemas/deals
GET /crm/v3/schemas/tickets
For custom objects:
GET /crm/v3/schemas