API endpoint to retrieve a list of all objects in a HubSpot account

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.

Thanks.

Hey @alvarofranz,

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:

GET https://api.hubapi.com/crm/v3/objects/2-116144016
RESPONSE:

{
 "results": [
 {
 "id": "1669847001",
 "properties": {
 "hs_createdate": "2023-07-19T08:53:04.087Z",
 "hs_lastmodifieddate": "2023-07-19T08:53:04.087Z",
 "hs_object_id": "1669847001"
 },
 "createdAt": "2023-07-19T08:53:04.087Z",
 "updatedAt": "2023-07-19T08:53:04.087Z",
 "archived": false
 },
 {
 "id": "1669847002",
 "properties": {
 "hs_createdate": "2023-07-19T08:53:07.950Z",
 "hs_lastmodifieddate": "2023-07-19T08:53:07.950Z",
 "hs_object_id": "1669847002"
 },
 "createdAt": "2023-07-19T08:53:07.950Z",
 "updatedAt": "2023-07-19T08:53:07.950Z",
 "archived": false
 }
 ]
}

Thanks but this doesn’t list all the custom objects, it requires to provide the custom object name. I want to list all custom objects.

Hey @alvarofranz,

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.

GET https://api.hubapi.com/crm/v3/schemas
RESPONSE

{
 "results": [
 {
 "labels": {
 "singular": "License",
 "plural": "Licences"
 },
 "requiredProperties": [],
 "searchableProperties": [],
 "primaryDisplayProperty": "license_type",
 "secondaryDisplayProperties": [],
 "description": null,
 "archived": false,
 "restorable": true,
 "metaType": "PORTAL_SPECIFIC",
 "id": "116144016",
 "fullyQualifiedName": "p140281183_licences",
 "createdAt": "2023-07-19T08:51:22.745Z",
 "updatedAt": "2023-07-19T08:51:22.745Z",
 "objectTypeId": "2-116144016",
 "properties": [],
 "associations": [],
 "name": "licences"
 },
 {
 "labels": {
 "singular": "Shipment",
 "plural": "Shipments"
 },
 "requiredProperties": [],
 "searchableProperties": [],
 "primaryDisplayProperty": "order_id",
 "secondaryDisplayProperties": [],
 "description": null,
 "archived": false,
 "restorable": true,
 "metaType": "PORTAL_SPECIFIC",
 "id": "116144011",
 "fullyQualifiedName": "p140281183_shipments",
 "createdAt": "2023-07-19T08:51:03.198Z",
 "updatedAt": "2023-07-19T08:51:03.198Z",
 "objectTypeId": "2-116144011",
 "properties": [],
 "associations": [ ],
 "name": "shipments"
 }
 ]
}

Thanks! That’s exactly what I was looking for. Appreciate your help.

Hi Cold ,

I need one help here , i want to retrive all objects + custom objects in single API Call , Please share your thought on this .

So basically i want all this objects + my custom object in single API call , please help here if possible.

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

Thanks - I’m looking to use the API to manage courses, which is a newer optional object. the endpoint isn’t either:

/crm/v3/schemas/course or
/crm/v3/schemas/courses

And it’s not listed as a custom object either. Any ideas how to reference it?

Actually I’ve found it through the /crm/v3/object-library/enablement endpoint.

There I saw I had exactly one object enabled with an id of 0-410, and with /crm/v3/objects/0-410 I’m able to retrieve courses