Use Business Units with API

Good morning,

I need to use Business Units with API.

I’ve found a property ‘hs_all_assigned_business_unit_ids’ that I can use for contact, company, deal and custom objects.
I see I can move objects through different business units using this property.

I didn’t find documentation related to this property, can I use it in an integration or are you planning to modify something in the future?

Also, it would be possibile to create custom properties related to single business units? I see I can do it through UI but I can’t do it though API with properties API.
Please let me know, thank you

Sebastiano

Hi @SZanni

Thank you for reaching out.

I want to tag some of our experts on this - @Teun @DanielSanchez do you have any thoughts for @SZanni on this?

Thank you!

Best

Tiphaine

Hello @SZanni, @TitiCuisset,
Any news regarding this topic ?
I have to build a custm object for a client and I was wondering how I could add the business unit field (similar to the one that’s automatically added to the contacts when you create multiple business units) to the new custom object.
My use case is simple, my client manages 3 brands and each organizes conferences and events.
I am creating an “Events” custom object and would like to tie each event to its own brand.
Many thanks !

Ludwig

The property is added automatically for any object but at beginning it’s hidden. You can change this with property API.

Thanks, I’ve done that and indeed I can now see the business units field in my custom object properties.
However, although I can select an option for the same field on a contact, the dropdown is empty on the custom object.
Anything I’m missing here or do you reckon it’s a bug ? The feature is indeed quite recent so that may be the case. If so, do you have any idea where to report that ? (Quite new to this forum)

@LMeert , could you send a screengrab of what you are seeing? Want to make sure I am clear :grinning_face:

Hi @dennisedson,
Sure thing, here it is:

This is a sample record on my “Events” custom object.
I’ve switched the “hidden” attribute of the property “hs_all_assigned_business_unit_ids” as Szanni suggested, so now it shows via the UI but I can’t select any value for this field.
I also cannot edit the content of the dropdown since it’s a Hubspot generated field.
What I’ve tried :
- forcing the “externalOptions” to true => API call is a success but nothing changes
- forcing the options of the dropdown to a test value => I get an error confirming this is read-only

Below is the same “Business unit” field for the contacts object :

If I’m not mistaken, and the “hs_all_assigned_business_unit_ids” field is indeed automatically added to every object, then unhiding should be enough to have it work properly, i.e. display the list of the business units you have created.

Hope it’s clearer this way !
Ludwig

Perfecto!

I will try to reproduce and report back :+1:

FYI, I have asked the team and am waiting for some feedback :grinning_face:

Thanks @dennisedson much appreciated :folded_hands:

Hello @dennisedson,
Any news re. this topic ? :slightly_smiling_face:

Have a good day !
Ludwig

Was this matter resolved? We have the same query.

Thanks so much

Good Afternoon,

I am currently building an integration between HubSpot and NetSuite. We have separate product lines, and so are using the business units to separate the contacts in hubspot for each of the product lines.

However, I cannot seem to find any documentation as to how to set the business unit property for a contact via the API. We are currently using the v1 API, but I am open to using the v3 API if that is what I need to do.

I do see that there is a property called “hs_all_assigned_business_unit_ids” in the contact API, but I am unclear how to set the business unit ID’s or how I can get the business unit ID values to set.

Can anyone clarify this for me?

Thanks so much for any guidance!

Darren Nay

@darren-kb ,

I am asking about this :grinning_face:

Thank you! Any guidance that you could provide would be appreciated very much! I reached out to HubSpot support also and they had told me that it may not be available in the API until the Business Units feature was out of Beta, but he did not sound sure.

@darren-kb ,

I am merging this post with the other related post that you are already a part of

Good Afternoon, has there been any traction on this question? I am also attempting to set the business unit for a contact via the API. I haven’t had any luck with anything I have tried thus far. I reached out to HubSpot support and they said that it may not be available to update via the API until the Business Units product has been released from Beta. They did not sound sure, however, so I thought I would reach out here and see if anyone else had had any luck with this.

Thanks for your help!

Darren

Alright all,

Here is what is what I have been told. Presently, this is not possible and there is no timeline for it. Would any of you be willing to create an idea post and link back here. If we can create enough buzz on this, I think we can move the needle of prioritization of it!

Hello SZanni, did you manage to get a fxi for this, I’d appreciate if you did and you can share.

I ran into a similar problem and noticed an error in my API call. I was trying to insert a busness unit through the API end point for business unit

“hs_all_assigned_business_unit_ids”: “GL- Business”

here ==> Property values were not valid: [{\“isValid\”:false,\“message\”:\"Attempted to insert non-long value
My value has a “-” in it, for example “GL-Business” as a business unit and i think that’s why it’s causing a failure.
Can anyone help please?

This error is indicating that you should use a number instead of text. Business units are identified by a numeric ID, and that property stores numeric ID and not strings.

I’m unsure if the property can be set, but it definitely does need to be a number (if it can be set at all.)