Our app helps users to create pages in HubSpot portal, it had been working fine until one or two weeks ago, since then it fails when calling POST /content/api/v2/pages with following error:
{"correlationId":"816b5c7b-58e3-4a6f-b051-973b07b1cbd7","errorTokens":{"action":["create"],"contentId":["10993330975"],"contentType":["site page"]},"errorType":"CONTENT_SCOPE_RESTRICTED","message":"User does not have permission to create the site page with id 10993330975.","requestId":"47a022b1-a6d2-4fda-b6b9-834997c00a8d","status":"error"}
Note that this only happens with site pages, the app can create landing page without error. I tested a few portals and all of them fails with the same error. Can you help us to fix it? Thank you.
Can you please tell how you are making API call like either with OAuth2.0 or API key. Its a user permission error for a API call. If you are using the oauth for the APP then make sure it is authorized either with the super admin user or respective user role who has the permission to create pages on HubSpot. It may be a case that the APP do not fulfills all the scopes while authorization by a user.
Hi @himanshurauthan , thank you for your reply. My app uses OAuth and it requests following scopes: `content contacts forms`. Even if I authorizes with Super Admin user, I still can't create site page (although I can create landing page as mentioned). Any idea?
@JoeHu Are you sending the request in JSON format. If so what data you are sending to headers. It should be "application/json" for POST request.
Rest I do not see any issue with your request. Was there any change made to the published APP in last hours as you mentioned the same was working fine for week or more.
@himanshurauthanYes I can confirm that I have set content type to "application/json", and I haven't modified the app for a while. Thanks for your help anyways.
This is a strange one. If you're authorizing with a Super Admin user, I definitely wouldn't expect you to encounter such an error.
Can you share your app ID and the Hub IDs of a few accounts you tested in? If there is more than one Super Admin in each account, can you confirm via DM which you used to connect the app?
Hi @IsaacTakushi , I just tested again and found that the issue disappeared by itself I didn't change any code and used same refresh token without re-authentication, so I am not really sure what happened. Anyways I am happy to see the issue got fixed. Thanks again!