Get Owner of a Contact by Contact API Endpoint.

Hi @HOrdonez

Relating to your original question --> yes, you can retrieve information about the owner of a Contact record, using the Contact API. For example:

GET
https://api.hubapi.com/crm/v3/objects/CONTACT/{{CONTACT_ID}}?properties=hubspot_owner_id,hubspot_owner_assigneddate,hubspot_team_id&hapikey={{HAPIKEY}}

Example Response Body:
{
 "id": {{CONTACT_ID}},
 "properties": {
 "createdate": "2019-01-30T12:55:07.451Z",
 "hs_object_id": {{CONTACT_ID}},
 "hubspot_owner_assigneddate": "2021-08-26T14:30:29.555Z",
 "hubspot_owner_id": {{CONTACT_OWNER_ID}},
 "hubspot_team_id": {{CONTACT_OWNER_TEAM_ID}},
 "lastmodifieddate": "2021-10-28T16:12:15.677Z"
 },
 "createdAt": "2019-01-30T12:55:07.451Z",
 "updatedAt": "2021-10-28T16:12:15.677Z",
 "archived": false
}

Likewise, specific property values can be retrieved when requesting lists or batches of Contacts via the API.

As @dennisedson mentioned, you can use the Get All Properties endpoint to inspect all available properties relevant to record ownership. Here are some I found that might be of interest (descriptions for each can be found in the API response):

  • hubspot_owner_id
  • hubspot_owner_assigneddate
  • hs_all_owner_ids
  • hs_user_ids_of_all_owners
  • hubspot_team_id
  • hs_all_team_ids
  • owneremail (marked as legacy, returned null for me)
  • ownername (marked as legacy, returned null for me)

Relating to your follow up question in this thread --> yes, it is possible to use the CRM Search API endpoint to retrieve a list of Contact records based on when they were last modified. For example:

POST
https://api.hubapi.com/crm/v3/objects/CONTACT/search?hapikey={{HAPIKEY}}

Request Body (JSON):
{
 "limit": 5,
 "filterGroups": [
 {
 "filters": [
 {
 "propertyName": "lastmodifieddate",
 "operator": "GTE",
 "value": "1635435000000"
 }
 ]
 }
 ]
}

For anyone not overly familiar with the CRM Search API --> “GTE” is the endpoint’s “greater than or equal to” operator, and “1635435000000” reflects the example target datetime in Unix epoch time (milliseconds). I generally use EpochConverter for generating test timestamps like this.

Finally, the Contact property being searched on in the above example is “lastmodifieddate”, not to be confused with “hs_lastmodifieddate”. The latter is a hidden property which, based on some very quick testing, cannot be used within CRM Search API filters.

Hope this helps :slightly_smiling_face:

All the best,

Zach