# Object request: Return only defined (not null) properties

**URL:** <https://community.hubspot.com/t/object-request-return-only-defined-not-null-properties/84061>\
**Category:** APIs & Integrations\
**Tags:** companies\
**Created:** [June 26, 2023, 6:02am UTC](https://community.hubspot.com/t/object-request-return-only-defined-not-null-properties/84061 "2023-06-26T06:02:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff00seattle](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jeff00seattle](https://community.hubspot.com/u/jeff00seattle)\
**Post date:** [June 26, 2023, 6:02am UTC](https://community.hubspot.com/t/object-request-return-only-defined-not-null-properties/84061/1 "2023-06-26T06:02:26Z")

</div>

@Teun

I started this thread, and to output all properties is exceptionally verbose, especially if the object type is “companies.”

[Object request: Return ALL properties](https://community.hubspot.com/t5/APIs-Integrations/Object-request-Return-ALL-properties/m-p/810944#M65139)

I wish to pull back and request return of only defined properties.

Examples…

1. HubSpot defined (ex: “hs\_object\_id”) and Client defined (ex. “name”).
2. Client defined (ex. “name”)

I appreciate v2 suggestion. Not yet deprecated, but not worth considering w/ expecation of being deprecated.

Thank you

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [June 26, 2023, 10:55pm UTC](https://community.hubspot.com/t/object-request-return-only-defined-not-null-properties/84061/2 "2023-06-26T22:55:10Z")

</div>

Hey, @jeff00seattle 👋 I’ll take on the HubSpot-specific questions here. A big thanks to @Teun for taking the time to offer one workaround 🙌

Housekeeping details — please refrain from starting multiple posts for the same topic. This helps keep the community stay organized and well run.

To your questions and comments:

- _It would be better to have a key word (example “properties=all"): “/crm/v3/objects/companies?archived=false&limit=10&properties=all" —_ I agree, and this is not an option.
- Teun’s suggestion on cacheing the response is like the most optimal, and I understand it’s not possible
- Their other suggestion is valid as well. The endpoint [Get a company by ID](https://legacydocs.hubspot.com/docs/methods/companies/get_company) is stable, supported, and not flagged for any changes.

I think the term “depreciated” in this case is a bit of a red herring. Unless something specifically labelled, either in its documentation or in the [HubSpot Developer Changelog](https://developers.hubspot.com/changelog), as _upcoming_ or _breaking changes_, there is no reason to assume it will not continue to be supported and stable. This applies to all of our v1 and Legacy endpoints.

From the [Legacy API documentation](https://legacydocs.hubspot.com/docs/overview#:~:text=our%20older%20endpoints%20are%20still%20stable%20and%20supported.%C2%A0):  
“…our older endpoints are still stable and supported.”  
and  
“Some older APIs don’t have an updated counterpart yet.”

 ![CleanShot 2023-06-26 at 16.33.59.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/b/2b968b30138b76c7fe152298c578c3b043030add.png)

In this case, a compromise of some sort will be made. There is not an all-in-one endpoint that meets your specific requirements.

Additionally, depending on how you need to make your queries, the [Search API](https://developers.hubspot.com/docs/api/crm/search#specify-returned-properties) may offer an option. You can add the properties in the request body and not to the request URL.

Myself, @Teun, and our community members are happy to help troubleshoot using the available options and limitations.

Talk soon. — Jaycee
