# ownwer data

**URL:** <https://community.hubspot.com/t/ownwer-data/111048>\
**Category:** APIs & Integrations\
**Tags:** timeline-and-extensions-apis\
**Created:** [July 10, 2024, 12:25pm UTC](https://community.hubspot.com/t/ownwer-data/111048 "2024-07-10T12:25:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AVidal53](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@AVidal53](https://community.hubspot.com/u/AVidal53)\
**Post date:** [July 10, 2024, 12:25pm UTC](https://community.hubspot.com/t/ownwer-data/111048/1 "2024-07-10T12:25:27Z")

</div>

Is possible to retrive the additional\_phone configured for an owner? Or add a custom field like “extension”.

Need to make a search for a phone number/contact and with the associated owner get the additional\_phone or extension

I’m using Get at :

[https://api.hubapi.com/crm/v3/owners](https://api.hubapi.com/crm/v3/owners)

---

<div class="post-metadata">

**Author:** ![Brenner](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brenner/32/13741_2.png) [@Brenner](https://community.hubspot.com/u/Brenner)\
**Post date:** [July 10, 2024, 4:38pm UTC](https://community.hubspot.com/t/ownwer-data/111048/2 "2024-07-10T16:38:24Z")

</div>

Hey @AVidal53 ! How’re you?

Here’s developer’s answer that I find:

_ **Retrieving Additional Phone Information for an Owner** _

**1. Retrieve Owners Data:**  
Use the endpoint `GET /owners/v2/owners` to get details about owners, including any additional phone information that may be configured.

Endpoint: `GET [https://api.hubspot.com/owners/v2/owners\`](https://api.hubspot.com/owners/v2/owners%5C%60)

Example code snippet:

```python  
import requests

# Define the API endpoint and your API key  
url = “[https://api.hubspot.com/owners/v2/owners](https://api.hubspot.com/owners/v2/owners)”  
api\_key = “YOUR\_API\_KEY\_HERE”

# Define headers with API key  
headers = {  
“Authorization”: f"Bearer {api\_key}",  
“Accept”: “application/json”  
}

# Make the request to retrieve owners data  
response = requests.get(url, headers=headers)

# Check if the request was successful  
if response.status\_code == 200:  
owners\_data = response.json().get(“owners”)  
for owner in owners\_data:  
owner\_id = owner.get(“ownerId”)  
owner\_email = owner.get(“email”)  
additional\_phone = owner.get(“phone”) # Assuming additional phone is stored in “phone” field  
extension = owner.get(“extension”) # Example if you add a custom extension field

print(f"Owner ID: {owner\_id}, Email: {owner\_email}, Additional Phone: {additional\_phone}, Extension: {extension}")  
else:  
# Request failed, print error message  
print(“Error:”, response.status\_code, response.text)  
```

In this updated example:  
- Replace `“YOUR_API_KEY_HERE”` with your actual HubSpot API key.  
- The code retrieves owner data using the correct endpoint and accesses fields like `phone` for additional phone information.  
- You can also add a custom field like `extension` and retrieve its value if it’s defined for owners in your HubSpot account.

_**Adding a Custom Field (e.g., Extension) for Owners**_

To add a custom field like “extension” for owners in HubSpot, you typically need to:

**1. Create a Custom Property - [details here](https://knowledge.hubspot.com/properties/create-and-edit-properties)**  
- Go to your HubSpot account and navigate to _Settings \> Properties \> Owners_.  
- Create a new custom property of type “Single Line Text” or any other suitable type for your extension field.

**2. Update Owner Data:**  
- You can update owner details via the HubSpot API using the endpoint `PUT /owners/v2/owners/{ownerId}`.  
- Include the new custom property (e.g., `extension`) in the JSON payload to update or add it to an owner’s profile.

Example update code (assuming `owner_id` and `extension_value` are defined):

```python  
# Define the API endpoint for updating an owner  
update\_url = f"[https://api.hubspot.com/owners/v2/owners/{owner\_id](https://api.hubspot.com/owners/v2/owners/%7Bowner_id)}"

# Define the payload with the custom property  
update\_payload = {  
“properties”: {  
“extension”: extension\_value  
}  
}

# Make the request to update the owner  
update\_response = requests.put(update\_url, headers=headers, json=update\_payload)

# Check if the update request was successful  
if update\_response.status\_code == 200:  
print(“Owner updated successfully.”)  
else:  
print(“Error updating owner:”, update\_response.status\_code, update\_response.text)  
```

- Replace `owner_id` with the actual owner ID you want to update.  
- Replace `extension_value` with the value you want to set for the extension field.

By following these updated steps based on the HubSpot Beta API documentation, you can effectively retrieve additional phone information for owners and add custom fields like “extension” using the HubSpot API. Adjust the code according to your specific requirements and your HubSpot account setup.

[HubSpot developers guide here](https://developers.hubspot.com/beta-docs/guides/api/overview).

Can you tell me if it works?

cheers

---

<div class="post-metadata">

**Author:** ![AVidal53](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@AVidal53](https://community.hubspot.com/u/AVidal53)\
**Post date:** [July 10, 2024, 8:25pm UTC](https://community.hubspot.com/t/ownwer-data/111048/3 "2024-07-10T20:25:55Z")

</div>

tried with the new api version

[https://api.hubapi.com/crm/v3/owners](https://api.hubapi.com/crm/v3/owners)

get all the owners , but fields from User\> Preferences like Job Title Main Phone or Additional Phone are not retrived

Had more succes with. [https://api.hubapi.com/crm/v3/objects/users?properties=hs\_job\_title,hs\_additional\_phone](https://api.hubapi.com/crm/v3/objects/users?properties=hs_job_title,hs_additional_phone)

Adding a custom field to Users seems unavaliable the Ownner Object can’t get new properties (don’t appear on menu)

---

<div class="post-metadata">

**Author:** ![Brenner](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brenner/32/13741_2.png) [@Brenner](https://community.hubspot.com/u/Brenner)\
**Post date:** [July 11, 2024, 4:46pm UTC](https://community.hubspot.com/t/ownwer-data/111048/4 "2024-07-11T16:46:29Z")

</div>

Can you tell me if it works?

import requests

# Define the API endpoint and your API key  
url = “[https://api.hubapi.com/crm/v3/objects/users](https://api.hubapi.com/crm/v3/objects/users)”  
api\_key = “YOUR\_API\_KEY\_HERE”

# Define the properties you want to retrieve  
properties = “hs\_job\_title,hs\_main\_phone,hs\_additional\_phone”

# Define headers with API key  
headers = {  
“Authorization”: f"Bearer {api\_key}",  
“Accept”: “application/json”  
}

# Define the query parameters  
params = {  
“properties”: properties  
}

# Make the request to retrieve users data with specified properties  
response = requests.get(url, headers=headers, params=params)

# Check if the request was successful  
if response.status\_code == 200:  
users\_data = response.json().get(“results”)  
for user in users\_data:  
user\_id = user.get(“id”)  
job\_title = user.get(“properties”, {}).get(“hs\_job\_title”, {}).get(“value”)  
main\_phone = user.get(“properties”, {}).get(“hs\_main\_phone”, {}).get(“value”)  
additional\_phone = user.get(“properties”, {}).get(“hs\_additional\_phone”, {}).get(“value”)

print(f"User ID: {user\_id}, Job Title: {job\_title}, Main Phone: {main\_phone}, Additional Phone: {additional\_phone}")  
else:  
# Request failed, print error message  
print(“Error:”, response.status\_code, response.text)

========================

Also, I think @danmoyle can help us as well.

---

<div class="post-metadata">

**Author:** ![AVidal53](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@AVidal53](https://community.hubspot.com/u/AVidal53)\
**Post date:** [July 12, 2024, 8:55am UTC](https://community.hubspot.com/t/ownwer-data/111048/5 "2024-07-12T08:55:10Z")

</div>

> * * *
> 
> @AVidal53 wrote:
> 
> Is possible to retrive the additional\_phone configured for an owner? Or add a custom field like “extension”.
> 
> Need to make a search for a phone number/contact and with the associated owner get the additional\_phone or extension
> 
> I’m using Get at :
> 
> [https://api.hubapi.com/crm/v3/owners](https://api.hubapi.com/crm/v3/owners)
> 
> * * *

Is not avaliable for me.

I can make a get at

[https://api.hubapi.com/crm/v3/objects/users](https://api.hubapi.com/crm/v3/objects/users) and get all the users, but would be better to make a search

but using [https://api.hubapi.com/settings/v3/users/$email?idProperty=EMAIL](https://api.hubapi.com/settings/v3/users/$email?idProperty=EMAIL)

the response can’t get the addicionals properties
