APIs & Integrations

cbsync
Member

/crm/v3/properties/company|contact|deal sort order

SOLVE

I'm curious what the default sort order for the following endpoints are as it does not seem to be documented:

/crm/v3/objects/companies

/crm/v3/objects/contacts

/crm/v3/objects/deals

/crm/v3/objects/owners

 

Also is it possible to sort these by a different field?

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

/crm/v3/properties/company|contact|deal sort order

SOLVE

Hey @cbsync,

 

The default sorting of these endpoints is probably from the oldest record to the newest. 

 

You can set the sort rule by a different property. Here's an example:

 

POST /crm/v3/objects/contacts/search

 

POST body

 

{
    "sorts": [
      {
        "propertyName": "createdate",
        "direction": "DESCENDING"
      }
    ]
  }

View solution in original post

0 Upvotes
3 Replies 3
pravinthakare
Participant

/crm/v3/properties/company|contact|deal sort order

SOLVE

just checking on this if it possible to do the sorting on the comapnies list without using search API
ex. fetch recently updated companies .

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

/crm/v3/properties/company|contact|deal sort order

SOLVE

Hey @cbsync,

 

The default sorting of these endpoints is probably from the oldest record to the newest. 

 

You can set the sort rule by a different property. Here's an example:

 

POST /crm/v3/objects/contacts/search

 

POST body

 

{
    "sorts": [
      {
        "propertyName": "createdate",
        "direction": "DESCENDING"
      }
    ]
  }
0 Upvotes
vikram-mit
Participant

/crm/v3/properties/company|contact|deal sort order

SOLVE

but that is using the serch api. I am like OP looking for object apis like https://api.hubapi.com/crm/v3/objects/companies 

is it possible to sort ?