https://developers.hubspot.com/docs/guides/api/settings/users/public-permissions documentation for retrieving a contact's permitted user lists according to the create, delete, and update options. But I want to retrieve a contact's permissions for only one user.
I followed this https://developers.hubspot.com/docs/guides/api/settings/users/public-permissions documentation, But I have to load all contacts for filter specific user's contacts permissions. This took too much time for me. Is there any direct solutions for Retrieve specific user's contacts permissions?
May 27, 20254:52 AM - edited May 27, 20255:06 AM
Top Contributor
Retrieve specific user's contacts permissions
SOLVE
Yes, that's normal. Sorry to have misled you. You can only retrieve users for a contact (deal, ticket, company) with this API. Nothing else.
But you can build a helper like that (my example is in Python) :
def get_user_permissions(data: dict, user_id: int) -> dict:
user_perms = {}
resources = data.get("resources", {})
for resource_id, actions in resources.items():
perms = []
for action_name, info in actions.items():
if user_id in info.get("permittedUsers", []):
perms.append(action_name)
if perms:
user_perms[resource_id] = perms
return user_perms
This way you pass the result (I took the response code from the documentation page) of your query (hcrn:999999:crm-object:0-1:123456) into the function:
May 27, 20254:52 AM - edited May 27, 20255:06 AM
Top Contributor
Retrieve specific user's contacts permissions
SOLVE
Yes, that's normal. Sorry to have misled you. You can only retrieve users for a contact (deal, ticket, company) with this API. Nothing else.
But you can build a helper like that (my example is in Python) :
def get_user_permissions(data: dict, user_id: int) -> dict:
user_perms = {}
resources = data.get("resources", {})
for resource_id, actions in resources.items():
perms = []
for action_name, info in actions.items():
if user_id in info.get("permittedUsers", []):
perms.append(action_name)
if perms:
user_perms[resource_id] = perms
return user_perms
This way you pass the result (I took the response code from the documentation page) of your query (hcrn:999999:crm-object:0-1:123456) into the function:
Have a lovely day and thanks so much in advance for your valuable contributions! Bérangère
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates. Learn More.