Need to set type of private access in web page API call

Hope someone can point me in the right direction. I’m creating a web page which I would like to publish with only private access. In order to do this I need to specify the type of private access in the create page API call, using this data:

"publicAccessRules": [
 {}
],

I don’t see any reference to the values needed for membership access. The documentation seems silent, and when I fetch the JSON for an existing page with the type of access I want, these values are not set in the return data.

Can anyone offer help here?

Hey @SteveHTM,

according to Cursor and the HubSpot Dev MCP (nice thing):

You can/should add PublicAccessRulesEnabled to your API call. This might trigger the whole required setup.

publicAccessRules are empty by default, but playing around I think it could be set up like this

hope this helps

Best,

Anton
Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges.

@Anton - helpful, but it seems that this is not the whole story.

Playing around a little more in Postman indicates that the first property needed in this array is “type” which apparently has to be one of:

must be one of: [CONTACT, ACCESS_GROUP_MEMBERSHIP, APP_AUTH, LIST_MEMBERSHIP, SSO_LOGIN, SSO_WITH_LIST_MEMBERSHIP, MEMBERSHIP_LOGIN, PUBLIC]"

I’ll continue to experiment, but it’s maddening that the information is not returned on existing manually created pages.

Steve

I worked it out eventually - a long buried community post here gave me a final clue. I don’t see why this should be made so hard!

The way to specify access list controlled access seems to be:

 "publicAccessRules": [
 {"type" : "ACCESS_GROUP_MEMBERSHIP",
 "ids": [your_access_list_id]}
 ],

It’s still not returned correctly in the API response.

In hope that this helps others,

Steve

FYI - after a number of days, response from the product team via support:

>>>

The team has reviewed your request regarding documenting the publicAccessRules structure and returning the manually set access group values via the fetch page API. At this time, they have decided that we will not be publicly documenting the publicAccessRules structure, as these values are intentionally omitted from being populated in the public APIs.

<<<

Steve

Hey @SteveHTM!
Thanks so much for updating this thread with the final findings. I realize it may not be an ideal reply, but it’s always better to have an official update than not.
Shane, Senior Community Moderator