Fetching only selected values in the getProperties API in HubSpot

I am using this api to fetch the object schema, but I dont need the “options” attribute that is fetched in the response, I am using the nodejs client library, and using the function

hubspotClient.crm.properties.coreApi.getAll()

Is there any way I can explicilty bring in only the required properties?

Hi @mhetreayush,

Unfortunately, the getAll() function in the Node.js library doesn’t have a built-in option to exclude specific fields like “options” in the response. It always returns the full schema.

However, there’s a workaround you can try.

After getting the full response, you can filter out the options attribute locally in your Node.js code using something like,
const properties = await hubspotClient.crm.properties.coreApi.getAll();
const filteredProperties = properties.body.results.map(prop => {
const { options, …rest } = prop;
return rest;
});
If you want more control, you could use HubSpot’s GraphQL API to fetch only the fields you need. It’ll require a bit more setup, but it’s a powerful way to get specific data without extra fields.

If it’s a recurring need, consider reaching out to HubSpot support to suggest adding field-level filters to the properties API could be a nice feature for future releases!

I hope it helps, let me know if you need to talk!

Khushboo Pokhriyal

Growth & Operations

GroRapid Labs

LinkedIn | 9315044754 | Email | Website

Thank you for the help Khushboo. GraphQL API is something that might help me.

Hi @mhetreayush

I think you are using V1 doc, you should move to the V3 APIs as they are more advanced and stable.

here is the link to CRM properties read API - Accounts Dashboard | HubSpot

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!

Thank you for the help Gaurav!