Getting permissions from API

Hi,

I’m trying to check if the user have a permission to create contact through hubspot API, is there any way to get permission set from API?

Thanks.

I don’t think this endpoint exists, however, you could work around it a few ways.

1. You can keep track locally of what the roles can access, then use this endpoint to see what role they have:

Accounts Dashboard | HubSpot → GET /roles

2. You can add the users as contacts then add the permissions as custom properties. Then you can use the contact endpoint to get that property.

Neither is perfect, but they should work.

Thanks for the response.

I understand that we could add users as contacts, but we don’t know for sure that there always will be the user in the contacts. So it might not work if there isn’t. Is that the only way? Thank you so much,

This is the best I could find. https://community.hubspot.com/t5/APIs-Integrations/Getting-User-Permissions-from-API/m-p/461797/highlight/true#M45159

Here, I have share API detail for your required user data. I hope it’s working.
While API calls you need to pass your user ID and your API token key.

curl --location 'https://api.hubapi.com/crm/v3/objects/users/362859434635?properties=hs_access%2Chs_assigned_seats%2Chs_family_name%2Chs_given_name%2Chs_email' \
--header 'Authorization: Bearer your_key_here' \
--header 'Accept: application/json' \
--data ''